Class: Movens::Configuration
- Inherits:
-
Object
- Object
- Movens::Configuration
- Defined in:
- lib/movens/configuration.rb
Constant Summary collapse
- OPTIONS =
[:host, :port]
Instance Attribute Summary collapse
-
#db ⇒ Object
Returns the value of attribute db.
-
#host ⇒ Object
Returns the value of attribute host.
-
#port ⇒ Object
Returns the value of attribute port.
Instance Method Summary collapse
- #[](option) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #merge(hash) ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
9 10 11 12 13 |
# File 'lib/movens/configuration.rb', line 9 def initialize @host = "movens.thnkslc.com" @port = "6380" @db = "movens" end |
Instance Attribute Details
#db ⇒ Object
Returns the value of attribute db.
7 8 9 |
# File 'lib/movens/configuration.rb', line 7 def db @db end |
#host ⇒ Object
Returns the value of attribute host.
5 6 7 |
# File 'lib/movens/configuration.rb', line 5 def host @host end |
#port ⇒ Object
Returns the value of attribute port.
6 7 8 |
# File 'lib/movens/configuration.rb', line 6 def port @port end |
Instance Method Details
#[](option) ⇒ Object
15 16 17 |
# File 'lib/movens/configuration.rb', line 15 def [](option) send(option) end |
#merge(hash) ⇒ Object
25 26 27 |
# File 'lib/movens/configuration.rb', line 25 def merge(hash) to_hash.merge(hash) end |
#to_hash ⇒ Object
19 20 21 22 23 |
# File 'lib/movens/configuration.rb', line 19 def to_hash OPTIONS.inject({}) do |hash, option| hash.merge(option.to_sym => send(option)) end end |