Sha256: ad2ca831af05f403b165de36e3d57d72337a0a2519868043ed788513a39d867e
Contents?: true
Size: 940 Bytes
Versions: 2
Compression:
Stored size: 940 Bytes
Contents
module StorageRoom class Entry < Model class_inheritable_accessor :collection class << self def index_path # :nodoc: "#{collection[:@url]}/entries" end def show_path(entry_id) # :nodoc: "#{index_path}/#{entry_id}" end def json_name # :nodoc: 'entry' end def search_path(parameters = {}) # :nodoc: parameters.present? ? "#{index_path}?#{parameters.to_query}" : index_path end # Search for objects with specific parameters def search(parameters = {}) Array.load(search_path(parameters)) end end # The collection of a entry def collection self.class.collection end # Has this Entry been trashed? def trashed? self[:@trash] end def id self[:@url] ? self[:@url].split('/').last : nil end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
storage_room-0.3.7 | lib/storage_room/models/entry.rb |
storage_room-0.3.6 | lib/storage_room/models/entry.rb |