Class: Atlas::Configuration
- Inherits:
-
Object
- Object
- Atlas::Configuration
- Defined in:
- lib/atlas/configuration.rb
Overview
Configuration handling for Atlas.
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Access token for Atlas.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Configuration
constructor
Create a new Configuration instance.
-
#to_h ⇒ Object
Hash representation of the configuration object.
-
#to_s ⇒ Object
String representation of the configuration.
Constructor Details
#initialize(opts = {}) ⇒ Configuration
Create a new Configuration instance
This also allows providing a hash of configuration values, which calls the accessor methods to full in the values.
11 12 13 14 15 |
# File 'lib/atlas/configuration.rb', line 11 def initialize(opts = {}) opts.each do |k, v| send("#{k}=".to_sym, v) end end |
Instance Attribute Details
#access_token ⇒ Object
Access token for Atlas
5 6 7 |
# File 'lib/atlas/configuration.rb', line 5 def access_token @access_token end |
Instance Method Details
#to_h ⇒ Object
Hash representation of the configuration object.
18 19 20 |
# File 'lib/atlas/configuration.rb', line 18 def to_h { access_token: @access_token } end |
#to_s ⇒ Object
String representation of the configuration.
23 24 25 26 |
# File 'lib/atlas/configuration.rb', line 23 def to_s objects = to_h.collect { |k, v| "#{k}=#{v}" }.join(' ') "#<#{self.class.name}:#{object_id} #{objects}" end |