class Fathom::Client

Constants

BASE_URL

Attributes

adapter[R]
api_key[R]

Public Class Methods

new(api_key:, adapter: Faraday.default_adapter) click to toggle source
# File lib/fathom/client.rb, line 7
def initialize(api_key:, adapter: Faraday.default_adapter)
  @api_key = api_key
  @adapter = adapter
end

Public Instance Methods

account() click to toggle source
# File lib/fathom/client.rb, line 12
def account
  AccountResource.new(self)
end
aggregations() click to toggle source
# File lib/fathom/client.rb, line 16
def aggregations
  AggregationsResource.new(self)
end
connection() click to toggle source
# File lib/fathom/client.rb, line 32
def connection
  @connection ||= Faraday.new do |conn|
    conn.url_prefix = BASE_URL
    conn.request :json
    conn.response :json, content_type: "application/json"
    conn.adapter adapter
  end
end
current_visitors() click to toggle source
# File lib/fathom/client.rb, line 20
def current_visitors
  CurrentVisitorsResource.new(self)
end
events() click to toggle source
# File lib/fathom/client.rb, line 24
def events
  EventsResource.new(self)
end
sites() click to toggle source
# File lib/fathom/client.rb, line 28
def sites
  SitesResource.new(self)
end