Class: TrackerApi::Endpoints::Blockers
- Defined in:
- lib/tracker_api/endpoints/blockers.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
Instance Method Summary collapse
- #get(project_id, story_id, params = {}) ⇒ Object
-
#initialize(client) ⇒ Blockers
constructor
A new instance of Blockers.
Constructor Details
#initialize(client) ⇒ Blockers
Returns a new instance of Blockers.
6 7 8 |
# File 'lib/tracker_api/endpoints/blockers.rb', line 6 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
4 5 6 |
# File 'lib/tracker_api/endpoints/blockers.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/blockers.rb', line 10 def get(project_id, story_id, params = {}) data = client.get("/projects/#{project_id}/stories/#{story_id}/blockers", params: params).body raise Errors::UnexpectedData, 'Array of Blockers expected' unless data.is_a? Array data.map do |blocker| Resources::Blocker.new({ client: client, project_id: project_id }.merge(blocker)) end end |