Class: FaxplusApi::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/faxplus_api/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(access_token: ENV['FAXPLUS_PAT_TOKEN']) ⇒ Client

Returns a new instance of Client.



15
16
17
18
# File 'lib/faxplus_api/client.rb', line 15

def initialize(access_token: ENV['FAXPLUS_PAT_TOKEN'])
  @access_token = access_token
  @base_url = BASE_URL
end

Instance Attribute Details

#access_tokenObject (readonly)

Returns the value of attribute access_token.



13
14
15
# File 'lib/faxplus_api/client.rb', line 13

def access_token
  @access_token
end

#base_urlObject (readonly)

Returns the value of attribute base_url.



13
14
15
# File 'lib/faxplus_api/client.rb', line 13

def base_url
  @base_url
end

Instance Method Details

#account(params = {}) ⇒ Object



24
25
26
# File 'lib/faxplus_api/client.rb', line 24

def (params = {})
  @account ||= Account.new(self)
end

#fax(params = {}) ⇒ Object



28
29
30
# File 'lib/faxplus_api/client.rb', line 28

def fax(params = {})
  @fax ||= Fax.new(self)
end

#file(params = {}) ⇒ Object



20
21
22
# File 'lib/faxplus_api/client.rb', line 20

def file(params = {})
  @file ||= File.new(self)
end

#number(params = {}) ⇒ Object



32
33
34
# File 'lib/faxplus_api/client.rb', line 32

def number(params = {})
  @number ||= Number.new(self)
end

#outbox(params = {}) ⇒ Object



36
37
38
# File 'lib/faxplus_api/client.rb', line 36

def outbox(params = {})
  @outbox ||= Outbox.new(self)
end

#webhook(params = {}) ⇒ Object



40
41
42
# File 'lib/faxplus_api/client.rb', line 40

def webhook(params = {})
  @webhook ||= Webhook.new(self)
end