Class: Pressy::LocalChangeset::AddedPost

Inherits:
Object
  • Object
show all
Defined in:
lib/pressy/changeset/local.rb

Querying the Changes collapse

Querying the Changes collapse

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

#idObject (readonly)

Returns the value of attribute id



87
88
89
# File 'lib/pressy/changeset/local.rb', line 87

def id
  @id
end

#postObject (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

#typeObject



98
99
100
# File 'lib/pressy/changeset/local.rb', line 98

def type
  :add
end