Class: Kobana::Client
- Inherits:
-
Object
- Object
- Kobana::Client
- Defined in:
- lib/kobana/client.rb
Defined Under Namespace
Classes: ResourceProxy
Instance Attribute Summary collapse
-
#configuration ⇒ Object
readonly
Returns the value of attribute configuration.
Instance Method Summary collapse
- #configure {|@configuration| ... } ⇒ Object
-
#initialize(api_token: nil, environment: :sandbox, custom_headers: {}, debug: false, **extra_config) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(api_token: nil, environment: :sandbox, custom_headers: {}, debug: false, **extra_config) ⇒ Client
Returns a new instance of Client.
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/kobana/client.rb', line 7 def initialize(api_token: nil, environment: :sandbox, custom_headers: {}, debug: false, **extra_config) @configuration = Configuration.new @configuration.api_token = api_token @configuration.environment = environment @configuration.custom_headers = custom_headers @configuration.debug = debug # Allow any additional configuration options extra_config.each do |key, value| @configuration.public_send("#{key}=", value) if @configuration.respond_to?("#{key}=") end end |
Instance Attribute Details
#configuration ⇒ Object (readonly)
Returns the value of attribute configuration.
5 6 7 |
# File 'lib/kobana/client.rb', line 5 def configuration @configuration end |
Instance Method Details
#configure {|@configuration| ... } ⇒ Object
20 21 22 |
# File 'lib/kobana/client.rb', line 20 def configure yield(@configuration) if block_given? end |