Sha256: 8aabe8fe3508e32ae8c89e1b1fdb580f92659582a21fba8c9e0596e4e6aabcda

Contents?: true

Size: 1.1 KB

Versions: 2

Compression:

Stored size: 1.1 KB

Contents

module Rainforest
  class DefaultClient < ApiClient

    def initialize(api_key)
      self.refresh_from(api_key)
    end

    def refresh_from(api_key)
      headers = {
        :Accept => "application/json",
        :"Content-Type" => "application/json",
        :CLIENT_TOKEN => api_key,
      }
      params = {}
      super(headers, params)
    end

    def client_stats
      @client_stats ||= ClientStatsEndpoint.new(self)
    end

    def environments
      @environments ||= EnvironmentsEndpoint.new(self)
    end

    def generators
      @generators ||= GeneratorsEndpoint.new(self)
    end

    def integrations
      @integrations ||= IntegrationsEndpoint.new(self)
    end

    def runs
      @runs ||= RunsEndpoint.new(self)
    end

    def schedules
      @schedules ||= SchedulesEndpoint.new(self)
    end

    def site_environments
      @site_environments ||= SiteEnvironmentsEndpoint.new(self)
    end

    def sites
      @sites ||= SitesEndpoint.new(self)
    end

    def tests
      @tests ||= TestsEndpoint.new(self)
    end

    def users
      @users ||= UsersEndpoint.new(self)
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rainforest-2.1.0 lib/rainforest/clients/default_client.rb
rainforest-2.0.2 lib/rainforest/clients/default_client.rb