Class: Fakturoid::Config
- Inherits:
-
Object
- Object
- Fakturoid::Config
- Defined in:
- lib/fakturoid/config.rb
Constant Summary collapse
- ENDPOINT =
'https://app.fakturoid.cz/api/v2'
Instance Attribute Summary collapse
-
#account ⇒ Object
Returns the value of attribute account.
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#email ⇒ Object
Returns the value of attribute email.
- #user_agent ⇒ Object
Instance Method Summary collapse
- #endpoint ⇒ Object
- #endpoint_without_account ⇒ Object
-
#initialize {|_self| ... } ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize {|_self| ... } ⇒ Config
Returns a new instance of Config.
8 9 10 |
# File 'lib/fakturoid/config.rb', line 8 def initialize(&_block) yield self end |
Instance Attribute Details
#account ⇒ Object
Returns the value of attribute account.
3 4 5 |
# File 'lib/fakturoid/config.rb', line 3 def account @account end |
#api_key ⇒ Object
Returns the value of attribute api_key.
3 4 5 |
# File 'lib/fakturoid/config.rb', line 3 def api_key @api_key end |
#email ⇒ Object
Returns the value of attribute email.
3 4 5 |
# File 'lib/fakturoid/config.rb', line 3 def email @email end |
#user_agent ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/fakturoid/config.rb', line 12 def user_agent if @user_agent.nil? || @user_agent.empty? "Fakturoid ruby gem (#{email})" else @user_agent end end |
Instance Method Details
#endpoint ⇒ Object
20 21 22 |
# File 'lib/fakturoid/config.rb', line 20 def endpoint "#{ENDPOINT}/accounts/#{account}" end |
#endpoint_without_account ⇒ Object
24 25 26 |
# File 'lib/fakturoid/config.rb', line 24 def endpoint_without_account ENDPOINT end |