Class: SiteMandala::Resource
- Inherits:
-
Object
- Object
- SiteMandala::Resource
show all
- Defined in:
- lib/sitemandala/resource.rb
Direct Known Subclasses
Alias, Blocks, Categories, Collections, Contacts, Domains, Emails, Events, Folders, Forms, Items, Lists, Menus, Notes, Organizations, Pages, Posts, Responses, Sections, Shorturls, Tags, Templates, Topics, Users
Class Attribute Summary collapse
Class Method Summary
collapse
Class Attribute Details
.resource ⇒ Object
Returns the value of attribute resource.
7
8
9
|
# File 'lib/sitemandala/resource.rb', line 7
def resource
@resource
end
|
Class Method Details
.all ⇒ Object
11
12
13
|
# File 'lib/sitemandala/resource.rb', line 11
def self.all
SiteMandala.get("/admin/#{resource}")
end
|
.create(data) ⇒ Object
19
20
21
|
# File 'lib/sitemandala/resource.rb', line 19
def self.create(data)
SiteMandala.post("/admin/#{resource}", data)
end
|
.delete(id) ⇒ Object
27
28
29
|
# File 'lib/sitemandala/resource.rb', line 27
def self.delete(id)
SiteMandala.delete("/admin/#{resource}/#{id}")
end
|
.find(id) ⇒ Object
15
16
17
|
# File 'lib/sitemandala/resource.rb', line 15
def self.find(id)
SiteMandala.get("/admin/#{resource}/#{id}")
end
|
.update(id, data) ⇒ Object
23
24
25
|
# File 'lib/sitemandala/resource.rb', line 23
def self.update(id, data)
SiteMandala.patch("/admin/#{resource}/#{id}", data)
end
|