Class: Grenache::Configuration
- Inherits:
-
Object
- Object
- Grenache::Configuration
- Defined in:
- lib/grenache/configurable.rb
Overview
Encapsulate Configuration parameters
Instance Attribute Summary collapse
-
#auto_announce ⇒ Object
Returns the value of attribute auto_announce.
-
#grape_address ⇒ Object
Returns the value of attribute grape_address.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Configuration
constructor
Initialize default values.
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_announce ⇒ Object
Returns the value of attribute auto_announce.
5 6 7 |
# File 'lib/grenache/configurable.rb', line 5 def auto_announce @auto_announce end |
#grape_address ⇒ Object
Returns the value of attribute grape_address.
5 6 7 |
# File 'lib/grenache/configurable.rb', line 5 def grape_address @grape_address end |
#timeout ⇒ Object
Returns the value of attribute timeout.
5 6 7 |
# File 'lib/grenache/configurable.rb', line 5 def timeout @timeout end |