Class: Grenache::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/grenache/configurable.rb

Overview

Encapsulate Configuration parameters

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ Configuration

Initialize default values



8
9
10
11
12
13
14
15
16
17
# File 'lib/grenache/configurable.rb', line 8

def initialize(params = {})
  if params
    self.grape_address = params[:grape_address]
    self.auto_announce = params[:auto_announce]
    self.timeout = params[:timeout]
  end
  self.grape_address ||= "ws://127.0.0.1:30001"
  self.auto_announce ||= true
  self.timeout ||= 5
end

Instance Attribute Details

#auto_announceObject

Returns the value of attribute auto_announce.



5
6
7
# File 'lib/grenache/configurable.rb', line 5

def auto_announce
  @auto_announce
end

#grape_addressObject

Returns the value of attribute grape_address.



5
6
7
# File 'lib/grenache/configurable.rb', line 5

def grape_address
  @grape_address
end

#timeoutObject

Returns the value of attribute timeout.



5
6
7
# File 'lib/grenache/configurable.rb', line 5

def timeout
  @timeout
end