Class: Synapse::Easy::Section::Tcp

Inherits:
Base
  • Object
show all
Defined in:
lib/synapse/easy/section/tcp.rb

Direct Known Subclasses

Http

Instance Attribute Summary collapse

Attributes inherited from Base

#address, #name, #options, #port, #type

Instance Method Summary collapse

Methods inherited from Base

#bind, #each, #label, #to_synapse

Constructor Details

#initialize(params = {}) ⇒ Tcp

Returns a new instance of Tcp.



8
9
10
11
12
13
14
# File 'lib/synapse/easy/section/tcp.rb', line 8

def initialize params={}
  super
  @type            = "frontend"
  @mode            = params[:mode]
  @mode          ||= :tcp
  @default_backend = params[:default_backend]
end

Instance Attribute Details

#default_backendObject

Returns the value of attribute default_backend.



7
8
9
# File 'lib/synapse/easy/section/tcp.rb', line 7

def default_backend
  @default_backend
end

#modeObject

Returns the value of attribute mode.



7
8
9
# File 'lib/synapse/easy/section/tcp.rb', line 7

def mode
  @mode
end

Instance Method Details

#section_optionsObject



15
16
17
18
19
20
# File 'lib/synapse/easy/section/tcp.rb', line 15

def section_options
  @options + [
    "mode #{mode}",
    "bind #{bind}",
  ].compact
end