Class: GatherContent::Api::Template

Inherits:
Base
  • Object
show all
Defined in:
lib/gather_content/api/template.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#fetch, #get, #post, #post_json, #reset

Constructor Details

#initialize(template_id, data = nil) ⇒ Template

Returns a new instance of Template.

Raises:

  • (ArgumentError)


6
7
8
9
10
# File 'lib/gather_content/api/template.rb', line 6

def initialize(template_id, data = nil)
  raise ArgumentError, "Template_id is required!" if template_id.nil?
  @template_id = template_id
  @data = data
end

Instance Attribute Details

#template_idObject

Returns the value of attribute template_id.



4
5
6
# File 'lib/gather_content/api/template.rb', line 4

def template_id
  @template_id
end

Instance Method Details

#[](key) ⇒ Object



12
13
14
# File 'lib/gather_content/api/template.rb', line 12

def [](key)
  fetch[key]
end