class TrackerApi::Endpoints::Projects

Attributes

client[RW]

Public Class Methods

new(client) click to toggle source
# File lib/tracker_api/endpoints/projects.rb, line 6
def initialize(client)
  @client = client
end

Public Instance Methods

get(params={}) click to toggle source
# File lib/tracker_api/endpoints/projects.rb, line 10
def get(params={})
  data = client.paginate('/projects', params: params)
  raise Errors::UnexpectedData, 'Array of projects expected' unless data.is_a? Array

  data.map { |project| Resources::Project.new({ client: client }.merge(project)) }
end