Class: Odnoklassniki::Config
- Inherits:
-
Object
- Object
- Odnoklassniki::Config
- Defined in:
- lib/odnoklassniki/config.rb
Constant Summary collapse
- VALID_OPTIONS_KEYS =
[:access_token, :client_id, :client_secret, :application_key].freeze
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Config
constructor
A new instance of Config.
- #options ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Config
Returns a new instance of Config.
17 18 19 20 21 22 |
# File 'lib/odnoklassniki/config.rb', line 17 def initialize(={}) @access_token = [:access_token] || ['access_token'] @client_id = [:client_id] || ['client_id'] @client_secret = [:client_secret] || ['client_secret'] @application_key = [:application_key] || ['application_key'] end |
Class Method Details
.configure {|config| ... } ⇒ Object
11 12 13 14 15 |
# File 'lib/odnoklassniki/config.rb', line 11 def self.configure config = self.new yield config config end |
Instance Method Details
#options ⇒ Object
24 25 26 27 28 |
# File 'lib/odnoklassniki/config.rb', line 24 def = {} VALID_OPTIONS_KEYS.each{ |pname| [pname] = send(pname) } end |