Class: BaiduApi::Geocoding::Configuration
- Inherits:
-
Object
- Object
- BaiduApi::Geocoding::Configuration
- Defined in:
- lib/baidu_api/geocoding/configuration.rb
Instance Attribute Summary collapse
-
#ak ⇒ Object
readonly
Returns the value of attribute ak.
-
#debug ⇒ Object
Returns the value of attribute debug.
-
#sk ⇒ Object
readonly
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.
7 8 9 10 11 12 |
# File 'lib/baidu_api/geocoding/configuration.rb', line 7 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 (readonly)
Returns the value of attribute ak.
5 6 7 |
# File 'lib/baidu_api/geocoding/configuration.rb', line 5 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 (readonly)
Returns the value of attribute sk.
5 6 7 |
# File 'lib/baidu_api/geocoding/configuration.rb', line 5 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
14 15 16 |
# File 'lib/baidu_api/geocoding/configuration.rb', line 14 def [](key) respond_to?(key) ? send(key) : nil end |