Sha256: 5c37620da56cb970436278fbd8d572a621cd0bfdd8f5d2b20bb5ebb052694ac7

Contents?: true

Size: 422 Bytes

Versions: 1

Compression:

Stored size: 422 Bytes

Contents

module TeamworkApi
  module API
    module Companies
      def company(company_id)
        response = get "/companies/#{company_id}.json"
        response.body['company']
      end

      def companies
        response = get '/companies.json'
        response.body['companies']
      end

      def company_by_name(company_name)
        companies.select { |c| c['name'] == company_name }.first
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
teamwork_api-0.1.0 lib/teamwork_api/api/companies.rb