Class: Pressy::LocalChangeset::AddedPost
- Inherits:
-
Object
- Object
- Pressy::LocalChangeset::AddedPost
- Defined in:
- lib/pressy/changeset/local.rb
Querying the Changes collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#post ⇒ Object
readonly
Returns the value of attribute post.
Querying the Changes collapse
- #==(other) ⇒ Object
- #execute(store) ⇒ Object
-
#initialize(id, post) ⇒ AddedPost
constructor
A new instance of AddedPost.
- #type ⇒ Object
Constructor Details
#initialize(id, post) ⇒ AddedPost
Returns a new instance of AddedPost
89 90 91 92 |
# File 'lib/pressy/changeset/local.rb', line 89 def initialize(id, post) @id = id @post = post end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id
87 88 89 |
# File 'lib/pressy/changeset/local.rb', line 87 def id @id end |
#post ⇒ Object (readonly)
Returns the value of attribute post
87 88 89 |
# File 'lib/pressy/changeset/local.rb', line 87 def post @post end |
Instance Method Details
#==(other) ⇒ Object
102 103 104 |
# File 'lib/pressy/changeset/local.rb', line 102 def ==(other) id == other.id && post == other.post end |
#execute(store) ⇒ Object
94 95 96 |
# File 'lib/pressy/changeset/local.rb', line 94 def execute(store) store.write(id, post) end |
#type ⇒ Object
98 99 100 |
# File 'lib/pressy/changeset/local.rb', line 98 def type :add end |