Class: Callcredit::Config
- Inherits:
-
Object
- Object
- Callcredit::Config
- Defined in:
- lib/callcredit/config.rb
Constant Summary collapse
- DEFAULT_OPTIONS =
{ adapter: Faraday.default_adapter, company: nil, username: nil, password: nil, application_name: nil, raw: false, api_endpoint: "https://ct.callcreditsecure.co.uk/callvalidateapi/" \ "incomingserver.php", user_agent: "Callcredit Ruby Gem #{Callcredit::VERSION}".freeze }.freeze
Instance Method Summary collapse
- #[](name) ⇒ Object
- #[]=(name, val) ⇒ Object
- #clone ⇒ Object
-
#initialize {|_self| ... } ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize {|_self| ... } ⇒ Config
Returns a new instance of Config.
15 16 17 18 |
# File 'lib/callcredit/config.rb', line 15 def initialize @config = {} yield self if block_given? end |
Instance Method Details
#[](name) ⇒ Object
20 21 22 |
# File 'lib/callcredit/config.rb', line 20 def [](name) @config.fetch(name, DEFAULT_OPTIONS[name]) end |
#[]=(name, val) ⇒ Object
24 25 26 |
# File 'lib/callcredit/config.rb', line 24 def []=(name, val) @config[name] = val end |