Class: GatherContent::Api::Templates
- Includes:
- Enumerable
- Defined in:
- lib/gather_content/api/templates.rb
Instance Attribute Summary collapse
-
#project_id ⇒ Object
Returns the value of attribute project_id.
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(project_id) ⇒ Templates
constructor
A new instance of Templates.
Methods inherited from Base
#fetch, #get, #post, #post_json, #reset
Constructor Details
#initialize(project_id) ⇒ Templates
Returns a new instance of Templates.
7 8 9 10 |
# File 'lib/gather_content/api/templates.rb', line 7 def initialize(project_id) raise ArgumentError, "project_id is required!" if project_id.nil? @project_id = project_id end |
Instance Attribute Details
#project_id ⇒ Object
Returns the value of attribute project_id.
4 5 6 |
# File 'lib/gather_content/api/templates.rb', line 4 def project_id @project_id end |
Instance Method Details
#each(&block) ⇒ Object
12 13 14 15 16 |
# File 'lib/gather_content/api/templates.rb', line 12 def each(&block) fetch.each do |template| yield GatherContent::Api::Template.new(template['id'], template) end end |