Class: Movens::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/movens/configuration.rb

Constant Summary collapse

OPTIONS =
[:host, :port]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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

#dbObject

Returns the value of attribute db.



7
8
9
# File 'lib/movens/configuration.rb', line 7

def db
  @db
end

#hostObject

Returns the value of attribute host.



5
6
7
# File 'lib/movens/configuration.rb', line 5

def host
  @host
end

#portObject

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_hashObject



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