Class: BaiduApi::Geocoding::Configuration
- Inherits:
-
Object
- Object
- BaiduApi::Geocoding::Configuration
- Defined in:
- lib/baidu_api/geocoding/configuration.rb
Instance Attribute Summary collapse
-
#ak ⇒ Object
Returns the value of attribute ak.
-
#debug ⇒ Object
Returns the value of attribute debug.
-
#sk ⇒ Object
Returns the value of attribute sk.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(options) ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(options) ⇒ Configuration
Returns a new instance of Configuration.
6 7 8 9 10 11 |
# File 'lib/baidu_api/geocoding/configuration.rb', line 6 def initialize() @ak = .fetch(:ak){ .fetch('ak') { fail ArgumentError, 'Missing argument :ak for configuration!' } } @sk = .fetch(:sk){ .fetch('sk', nil) } @version = .fetch(:version){ .fetch('version', 'v2') } @debug = .fetch(:debug){ .fetch('debug', false) } end |
Instance Attribute Details
#ak ⇒ Object
Returns the value of attribute ak.
4 5 6 |
# File 'lib/baidu_api/geocoding/configuration.rb', line 4 def ak @ak end |
#debug ⇒ Object
Returns the value of attribute debug.
4 5 6 |
# File 'lib/baidu_api/geocoding/configuration.rb', line 4 def debug @debug end |
#sk ⇒ Object
Returns the value of attribute sk.
4 5 6 |
# File 'lib/baidu_api/geocoding/configuration.rb', line 4 def sk @sk end |
#version ⇒ Object
Returns the value of attribute version.
4 5 6 |
# File 'lib/baidu_api/geocoding/configuration.rb', line 4 def version @version end |
Instance Method Details
#[](key) ⇒ Object
13 14 15 |
# File 'lib/baidu_api/geocoding/configuration.rb', line 13 def [](key) respond_to?(key) ? send(key) : nil end |