Class: Captivus::Configuration
- Inherits:
-
Object
- Object
- Captivus::Configuration
- Defined in:
- lib/captivus/configuration.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#api_secret_key ⇒ Object
Returns the value of attribute api_secret_key.
-
#development_environments ⇒ Object
Returns the value of attribute development_environments.
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#host ⇒ Object
Returns the value of attribute host.
-
#scheme ⇒ Object
Returns the value of attribute scheme.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #configure(attrs = {}) {|_self| ... } ⇒ Object
-
#initialize(attrs = {}, &block) ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(attrs = {}, &block) ⇒ Configuration
Returns a new instance of Configuration.
3 4 5 6 7 8 9 10 11 |
# File 'lib/captivus/configuration.rb', line 3 def initialize(attrs = {}, &block) defaults = { :scheme => 'http', :host => 'api.captiv.us', :environment => 'production', :development_environments => %w[development test] } configure defaults.merge(attrs), &block end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
13 14 15 |
# File 'lib/captivus/configuration.rb', line 13 def api_key @api_key end |
#api_secret_key ⇒ Object
Returns the value of attribute api_secret_key.
13 14 15 |
# File 'lib/captivus/configuration.rb', line 13 def api_secret_key @api_secret_key end |
#development_environments ⇒ Object
Returns the value of attribute development_environments.
13 14 15 |
# File 'lib/captivus/configuration.rb', line 13 def development_environments @development_environments end |
#environment ⇒ Object
Returns the value of attribute environment.
13 14 15 |
# File 'lib/captivus/configuration.rb', line 13 def environment @environment end |
#host ⇒ Object
Returns the value of attribute host.
13 14 15 |
# File 'lib/captivus/configuration.rb', line 13 def host @host end |
#scheme ⇒ Object
Returns the value of attribute scheme.
13 14 15 |
# File 'lib/captivus/configuration.rb', line 13 def scheme @scheme end |
Instance Method Details
#==(other) ⇒ Object
21 22 23 |
# File 'lib/captivus/configuration.rb', line 21 def ==(other) other.is_a?(Captivus::Configuration) && host == other.host end |
#configure(attrs = {}) {|_self| ... } ⇒ Object
15 16 17 18 19 |
# File 'lib/captivus/configuration.rb', line 15 def configure(attrs = {}) attrs.each { |attr, value| send "#{attr}=", value } yield self if block_given? self end |