module Arke::Resource::Persistence

Public Instance Methods

destroy() click to toggle source
# File lib/arke/resource/persistence.rb, line 47
def destroy
  delete @_attributes
end
persisted?() click to toggle source
# File lib/arke/resource/persistence.rb, line 71
def persisted?
  !self.id.empty?
end
reload() click to toggle source
# File lib/arke/resource/persistence.rb, line 66
def reload
  @_attributes = self.get(@_attributes.clone)
  self
end
save() click to toggle source
# File lib/arke/resource/persistence.rb, line 51
def save
  unless self.persisted?
    return true if (@_attributes = post(@_attributes))
  else
    return update(@_attributes)
  end
  false
end
update(attributes) click to toggle source
# File lib/arke/resource/persistence.rb, line 60
def update(attributes)
  @_attributes = attributes
  return true if (@_attributes = put(@_attributes))
  false
end

Private Instance Methods

destroy_with_after_destroy() click to toggle source
# File lib/arke/resource/persistence.rb, line 77
def destroy_with_after_destroy
  destroy_without_after_destroy
  self.after_destroy_callbacks ||= []
  self.after_destroy_callbacks.each do |callback|
    execute_callback(callback)
  end
end