Class: PortaText::Command::Api::Templates
- Defined in:
- lib/portatext/command/api/templates.rb
Overview
The templates endpoint. github.com/PortaText/docs/wiki/REST-API#api_templates
- Author
-
Marcelo Gornstein ([email protected])
- Copyright
-
Copyright © 2015 PortaText
- License
-
Apache-2.0
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #description(description) ⇒ Object
- #endpoint(_method) ⇒ Object
- #id(id) ⇒ Object
- #name(name) ⇒ Object
- #text(text) ⇒ Object
Methods inherited from Base
#accept_content_type, #body, #content_type, #delete, #get, #initialize, #patch, #post, #put, #set
Constructor Details
This class inherits a constructor from PortaText::Command::Base
Instance Method Details
#description(description) ⇒ Object
19 20 21 |
# File 'lib/portatext/command/api/templates.rb', line 19 def description(description) set :description, description end |
#endpoint(_method) ⇒ Object
27 28 29 30 31 32 |
# File 'lib/portatext/command/api/templates.rb', line 27 def endpoint(_method) return 'templates' if @args[:id].nil? id = @args[:id] @args.delete :id "templates/#{id}" end |
#id(id) ⇒ Object
11 12 13 |
# File 'lib/portatext/command/api/templates.rb', line 11 def id(id) set :id, id end |
#name(name) ⇒ Object
15 16 17 |
# File 'lib/portatext/command/api/templates.rb', line 15 def name(name) set :name, name end |
#text(text) ⇒ Object
23 24 25 |
# File 'lib/portatext/command/api/templates.rb', line 23 def text(text) set :text, text end |