Class: GatherContent::Api::Statuses

Inherits:
Base
  • Object
show all
Includes:
Enumerable
Defined in:
lib/gather_content/api/statuses.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

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

Constructor Details

#initialize(project_id) ⇒ Statuses

Returns a new instance of Statuses.

Raises:

  • (ArgumentError)


8
9
10
11
# File 'lib/gather_content/api/statuses.rb', line 8

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

Instance Attribute Details

#project_idObject

Returns the value of attribute project_id.



5
6
7
# File 'lib/gather_content/api/statuses.rb', line 5

def project_id
  @project_id
end

Instance Method Details

#each(&block) ⇒ Object



13
14
15
16
17
# File 'lib/gather_content/api/statuses.rb', line 13

def each(&block)
  fetch.each do |status|
    yield GatherContent::Api::Status.new(@project_id, status['id'], status)
  end
end