Class: Thingdeck::Property
- Inherits:
-
Object
- Object
- Thingdeck::Property
- Defined in:
- lib/thingdeck/property.rb
Instance Method Summary collapse
- #all(id, type, params = {}) ⇒ Object
- #create(id, type, params) ⇒ Object
- #destroy(id, type, pid) ⇒ Object
- #find(id, type, pid, params = {}) ⇒ Object
-
#initialize(wrapper) ⇒ Property
constructor
A new instance of Property.
Constructor Details
#initialize(wrapper) ⇒ Property
Returns a new instance of Property.
3 4 5 |
# File 'lib/thingdeck/property.rb', line 3 def initialize(wrapper) @wrapper = wrapper end |
Instance Method Details
#all(id, type, params = {}) ⇒ Object
7 8 9 10 |
# File 'lib/thingdeck/property.rb', line 7 def all(id, type, params = {}) url = collection_url(id, type) @wrapper.perform_request { |c| c.get(url, params) } end |
#create(id, type, params) ⇒ Object
17 18 19 20 |
# File 'lib/thingdeck/property.rb', line 17 def create(id, type, params) url = collection_url(id, type) @wrapper.perform_request { |c| c.post(url, params) } end |
#destroy(id, type, pid) ⇒ Object
22 23 24 25 |
# File 'lib/thingdeck/property.rb', line 22 def destroy(id, type, pid) url = single_url(id, type, pid) @wrapper.perform_request { |c| c.delete(url) } end |
#find(id, type, pid, params = {}) ⇒ Object
12 13 14 15 |
# File 'lib/thingdeck/property.rb', line 12 def find(id, type, pid, params = {}) url = single_url(id, type, pid) @wrapper.perform_request { |c| c.get(url, params) } end |