Class: WishSimple::Resource
- Inherits:
-
Object
- Object
- WishSimple::Resource
- Defined in:
- lib/wishsimple/resource.rb
Constant Summary collapse
- ATTRS =
[]
Instance Attribute Summary collapse
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
6 7 8 |
# File 'lib/wishsimple/resource.rb', line 6 def created_at @created_at end |
Class Method Details
.create(*args) ⇒ Object
8 9 10 |
# File 'lib/wishsimple/resource.rb', line 8 def self.create(*args) new(*args).save end |
Instance Method Details
#destroy ⇒ Object
17 18 19 20 |
# File 'lib/wishsimple/resource.rb', line 17 def destroy WishSimple.delete(path) self end |
#save ⇒ Object
12 13 14 15 |
# File 'lib/wishsimple/resource.rb', line 12 def save response = WishSimple.put(path, params) response.success? ? build_from_response(response) : self end |