Class: TrackerApi::Endpoints::Workspaces
- Defined in:
- lib/tracker_api/endpoints/workspaces.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
Instance Method Summary collapse
- #get(params = {}) ⇒ Object
-
#initialize(client) ⇒ Workspaces
constructor
A new instance of Workspaces.
Constructor Details
#initialize(client) ⇒ Workspaces
Returns a new instance of Workspaces.
6 7 8 |
# File 'lib/tracker_api/endpoints/workspaces.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/workspaces.rb', line 4 def client @client end |
Instance Method Details
#get(params = {}) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/tracker_api/endpoints/workspaces.rb', line 10 def get(params={}) data = client.paginate('/my/workspaces', params: params) raise Errors::UnexpectedData, 'Array of workspaces expected' unless data.is_a? Array data.map { |workspace| Resources::Workspace.new({ client: client }.merge(workspace)) } end |