Class: GatherContent::Api::Project

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

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

Constructor Details

#initialize(project_id, data = nil) ⇒ Project

Returns a new instance of Project.

Raises:

  • (ArgumentError)


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

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

Instance Attribute Details

#project_idObject

Returns the value of attribute project_id.



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

def project_id
  @project_id
end

Instance Method Details

#[](key) ⇒ Object



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

def [](key)
  fetch[key]
end