Module: Paperlex::RootObject::ClassMethods
- Defined in:
- lib/paperlex/base/root_object.rb
Instance Method Summary collapse
Instance Method Details
#all ⇒ Object
14 15 16 |
# File 'lib/paperlex/base/root_object.rb', line 14 def all get(collection_url).map {|attrs| new(attrs) } end |
#collection_url ⇒ Object
6 7 8 |
# File 'lib/paperlex/base/root_object.rb', line 6 def collection_url "#{url_name}.json" end |
#find(uuid) ⇒ Object
18 19 20 |
# File 'lib/paperlex/base/root_object.rb', line 18 def find(uuid) new(get(url_for(uuid))) end |
#url_for(uuid) ⇒ Object
10 11 12 |
# File 'lib/paperlex/base/root_object.rb', line 10 def url_for(uuid) "#{url_name}/#{uuid}.json" end |