Class: TrackerApi::Endpoints::StoryOwners

Inherits:
Object
  • Object
show all
Defined in:
lib/tracker_api/endpoints/story_owners.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ StoryOwners

Returns a new instance of StoryOwners.



6
7
8
# File 'lib/tracker_api/endpoints/story_owners.rb', line 6

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientObject

Returns the value of attribute client.



4
5
6
# File 'lib/tracker_api/endpoints/story_owners.rb', line 4

def client
  @client
end

Instance Method Details

#get(project_id, story_id, params = {}) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/tracker_api/endpoints/story_owners.rb', line 10

def get(project_id, story_id, params={})
  data = client.paginate("/projects/#{project_id}/stories/#{story_id}/owners", params: params)
  raise Errors::UnexpectedData, 'Array of story owners expected' unless data.is_a? Array

  data.map do |owner|
    Resources::Person.new({ story_id: story_id }.merge(owner))
  end
end