Class: Synapse::Easy::Section::Base
- Inherits:
-
Object
- Object
- Synapse::Easy::Section::Base
- Includes:
- Fake::Hash
- Defined in:
- lib/synapse/easy/section/base.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
Returns the value of attribute address.
-
#mode ⇒ Object
Returns the value of attribute mode.
-
#name ⇒ Object
Returns the value of attribute name.
-
#options ⇒ Object
Returns the value of attribute options.
-
#port ⇒ Object
Returns the value of attribute port.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #bind ⇒ Object
- #each(*args, &block) ⇒ Object
-
#initialize(params = {}) ⇒ Base
constructor
A new instance of Base.
- #label ⇒ Object
- #section_options ⇒ Object
- #to_synapse ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ Base
Returns a new instance of Base.
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/synapse/easy/section/base.rb', line 11 def initialize params={} @address = params[:address] @address ||= "localhost" @port = params[:port] @port ||= Freeport.port @name = params[:name] @type = params[:type] @type ||= "frontend" @type = params[:mode] @type ||= :http @options = params[:options] @options ||= [] end |
Instance Attribute Details
#address ⇒ Object
Returns the value of attribute address.
10 11 12 |
# File 'lib/synapse/easy/section/base.rb', line 10 def address @address end |
#mode ⇒ Object
Returns the value of attribute mode.
10 11 12 |
# File 'lib/synapse/easy/section/base.rb', line 10 def mode @mode end |
#name ⇒ Object
Returns the value of attribute name.
10 11 12 |
# File 'lib/synapse/easy/section/base.rb', line 10 def name @name end |
#options ⇒ Object
Returns the value of attribute options.
10 11 12 |
# File 'lib/synapse/easy/section/base.rb', line 10 def @options end |
#port ⇒ Object
Returns the value of attribute port.
10 11 12 |
# File 'lib/synapse/easy/section/base.rb', line 10 def port @port end |
#type ⇒ Object
Returns the value of attribute type.
10 11 12 |
# File 'lib/synapse/easy/section/base.rb', line 10 def type @type end |
Instance Method Details
#bind ⇒ Object
33 34 35 |
# File 'lib/synapse/easy/section/base.rb', line 33 def bind [address,port].compact.join(":") end |
#each(*args, &block) ⇒ Object
30 31 32 |
# File 'lib/synapse/easy/section/base.rb', line 30 def each *args, &block .each(*args,&block) end |
#label ⇒ Object
24 25 26 |
# File 'lib/synapse/easy/section/base.rb', line 24 def label "#{type} #{name}" end |
#section_options ⇒ Object
27 28 29 |
# File 'lib/synapse/easy/section/base.rb', line 27 def end |
#to_synapse ⇒ Object
36 37 38 39 40 |
# File 'lib/synapse/easy/section/base.rb', line 36 def to_synapse { label => } end |