Module: Jaysus::Remote::ClassMethods
- Defined in:
- lib/jaysus/remote.rb
Instance Method Summary collapse
Instance Method Details
#all ⇒ Object
55 56 57 58 59 60 61 62 63 |
# File 'lib/jaysus/remote.rb', line 55 def all records = [] ActiveSupport::JSON.decode(RestClient.get(model_url,{ 'Accept' => 'application/json' })).each do |raw_record| records << new(raw_record[self.singular_object_name]) end records end |
#find(id) ⇒ Object
65 66 67 68 69 70 71 |
# File 'lib/jaysus/remote.rb', line 65 def find(id) super do RestClient.get("#{model_url}/#{id}",{ 'Accept' => 'application/json' }) end end |