Class: TiendaNube::Resource::Base
- Inherits:
-
Object
- Object
- TiendaNube::Resource::Base
show all
- Defined in:
- lib/tiendanube/resource.rb
Class Attribute Summary collapse
Class Method Summary
collapse
Class Attribute Details
.name ⇒ Object
Returns the value of attribute name.
66
67
68
|
# File 'lib/tiendanube/resource.rb', line 66
def name
@name
end
|
Class Method Details
.all(query = {}) ⇒ Object
68
69
70
|
# File 'lib/tiendanube/resource.rb', line 68
def self.all(query={})
Resource.get(self.name, query)
end
|
.create(data) ⇒ Object
77
78
79
|
# File 'lib/tiendanube/resource.rb', line 77
def self.create(data)
Resource.post(self.name, data)
end
|
.delete(id) ⇒ Object
74
75
76
|
# File 'lib/tiendanube/resource.rb', line 74
def self.delete(id)
Resource.delete("#{self.name}/#{id}")
end
|
.from_url(url) ⇒ Object
83
84
85
|
# File 'lib/tiendanube/resource.rb', line 83
def self.from_url(url)
Resource.get(url)
end
|
.get(id) ⇒ Object
71
72
73
|
# File 'lib/tiendanube/resource.rb', line 71
def self.get(id)
Resource.get("#{self.name}/#{id}")
end
|
.update(id, data) ⇒ Object
80
81
82
|
# File 'lib/tiendanube/resource.rb', line 80
def self.update(id, data)
Resource.put("#{self.name}/#{id}", data)
end
|