Class: Tarpon::Client

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Configuration
Defined in:
lib/tarpon/client.rb

Instance Attribute Summary

Attributes included from Configuration

#base_uri, #http_middleware, #public_api_key, #secret_api_key, #timeout

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Configuration

#configure

Constructor Details

#initialize(**config) {|_self| ... } ⇒ Client

Returns a new instance of Client.

Yields:

  • (_self)

Yield Parameters:



14
15
16
17
# File 'lib/tarpon/client.rb', line 14

def initialize(**config, &block)
  config.each { |key, val| public_send("#{key}=", val) }
  yield self if block
end

Class Method Details

.defaultObject



10
11
12
# File 'lib/tarpon/client.rb', line 10

def self.default
  @default ||= new
end

Instance Method Details

#receiptObject



29
30
31
# File 'lib/tarpon/client.rb', line 29

def receipt
  Request::Receipt.new(client: self)
end

#subscriber(app_user_id) ⇒ Object



25
26
27
# File 'lib/tarpon/client.rb', line 25

def subscriber(app_user_id)
  Request::Subscriber.new(app_user_id: app_user_id, client: self)
end