Class: Accredible::Template
- Inherits:
-
Object
- Object
- Accredible::Template
- Defined in:
- lib/accredible-ruby/template.rb
Class Method Summary collapse
- .api_end_point(id = nil) ⇒ Object
- .copy(source_id:, new_template_name:) ⇒ Object
- .copy_end_point ⇒ Object
- .delete(template_id) ⇒ Object
- .view_all ⇒ Object
- .view_all_end_point ⇒ Object
Class Method Details
.api_end_point(id = nil) ⇒ Object
21 22 23 |
# File 'lib/accredible-ruby/template.rb', line 21 def self.api_end_point(id = nil) Accredible.api_url("templates/#{id}") end |
.copy(source_id:, new_template_name:) ⇒ Object
4 5 6 7 8 9 |
# File 'lib/accredible-ruby/template.rb', line 4 def self.copy(source_id:, new_template_name:) uri = Template.copy_end_point params = {source_id: source_id, new_template_name: new_template_name}.to_json Accredible.request(uri, :post, params) end |
.copy_end_point ⇒ Object
25 26 27 |
# File 'lib/accredible-ruby/template.rb', line 25 def self.copy_end_point Accredible.api_url("templates/copy") end |
.delete(template_id) ⇒ Object
11 12 13 14 |
# File 'lib/accredible-ruby/template.rb', line 11 def self.delete(template_id) uri = Template.api_end_point(template_id) Accredible.request(uri, :delete) end |
.view_all ⇒ Object
16 17 18 19 |
# File 'lib/accredible-ruby/template.rb', line 16 def self.view_all uri = Template.view_all_end_point Accredible.request(uri) end |
.view_all_end_point ⇒ Object
29 30 31 |
# File 'lib/accredible-ruby/template.rb', line 29 def self.view_all_end_point Accredible.api_url("templates") end |