Class: Pressy::LocalChangeset::DeletedPost

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) ⇒ DeletedPost

Returns a new instance of DeletedPost



136
137
138
139
# File 'lib/pressy/changeset/local.rb', line 136

def initialize(id, post)
  @id = id
  @post = post
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id



134
135
136
# File 'lib/pressy/changeset/local.rb', line 134

def id
  @id
end

#postObject (readonly)

Returns the value of attribute post



134
135
136
# File 'lib/pressy/changeset/local.rb', line 134

def post
  @post
end

Instance Method Details

#==(other) ⇒ Object



149
150
151
# File 'lib/pressy/changeset/local.rb', line 149

def ==(other)
  post == other.post
end

#execute(store) ⇒ Object



141
142
143
# File 'lib/pressy/changeset/local.rb', line 141

def execute(store)
  store.delete(id, post)
end

#typeObject



145
146
147
# File 'lib/pressy/changeset/local.rb', line 145

def type
  :delete
end