Class: GemJar::Resource::Base
- Inherits:
-
Object
- Object
- GemJar::Resource::Base
- Defined in:
- lib/gemjar/resource/base.rb
Class Method Summary collapse
Class Method Details
.all ⇒ Object
16 17 18 |
# File 'lib/gemjar/resource/base.rb', line 16 def all JSON.parse @rest[@resource].get(:accept => :json) end |
.create(opts) ⇒ Object
20 21 22 |
# File 'lib/gemjar/resource/base.rb', line 20 def create(opts) @rest[@resource].post opts.merge(:accept => :json) end |
.destroy(id) ⇒ Object
24 25 26 27 |
# File 'lib/gemjar/resource/base.rb', line 24 def destroy(id) path = [@resource, id].join('/') @rest[path].delete end |