Class: Sox::Client
Instance Attribute Summary collapse
-
#base_url ⇒ Object
readonly
Returns the value of attribute base_url.
Instance Method Summary collapse
- #auth ⇒ Object
- #clients ⇒ Object
-
#initialize(subdomain, api_token) ⇒ Client
constructor
A new instance of Client.
- #projects ⇒ Object
Methods included from Proxy
Constructor Details
#initialize(subdomain, api_token) ⇒ Client
Returns a new instance of Client.
7 8 9 10 |
# File 'lib/sox/client.rb', line 7 def initialize(subdomain, api_token) @base_url = "https://#{subdomain}.freshbooks.com/api/#{Sox::API_VERSION}/xml-in" @api_token = api_token end |
Instance Attribute Details
#base_url ⇒ Object (readonly)
Returns the value of attribute base_url.
5 6 7 |
# File 'lib/sox/client.rb', line 5 def base_url @base_url end |
Instance Method Details
#auth ⇒ Object
12 13 14 |
# File 'lib/sox/client.rb', line 12 def auth { username: @api_token, password: 'X' } end |
#clients ⇒ Object
16 17 18 |
# File 'lib/sox/client.rb', line 16 def clients proxy(:client) end |
#projects ⇒ Object
20 21 22 |
# File 'lib/sox/client.rb', line 20 def projects proxy(:project) end |