Class: Metatron::Templates::Gateway::Listener
- Inherits:
-
Object
- Object
- Metatron::Templates::Gateway::Listener
- Defined in:
- lib/metatron/templates/gateway/listener.rb
Overview
Internal model for a Gateway listener
Instance Attribute Summary collapse
-
#allowed_routes ⇒ Object
Returns the value of attribute allowed_routes.
-
#hostname ⇒ Object
Returns the value of attribute hostname.
-
#name ⇒ Object
Returns the value of attribute name.
-
#port ⇒ Object
Returns the value of attribute port.
-
#protocol ⇒ Object
Returns the value of attribute protocol.
-
#tls ⇒ Object
Returns the value of attribute tls.
Instance Method Summary collapse
-
#initialize(name, port:, protocol:, hostname: nil, tls: nil, allowed_routes: nil) ⇒ Listener
constructor
A new instance of Listener.
- #render ⇒ Object
Constructor Details
#initialize(name, port:, protocol:, hostname: nil, tls: nil, allowed_routes: nil) ⇒ Listener
Returns a new instance of Listener.
10 11 12 13 14 15 16 17 |
# File 'lib/metatron/templates/gateway/listener.rb', line 10 def initialize(name, port:, protocol:, hostname: nil, tls: nil, allowed_routes: nil) @name = name @port = port @protocol = protocol @hostname = hostname @tls = tls @allowed_routes = allowed_routes end |
Instance Attribute Details
#allowed_routes ⇒ Object
Returns the value of attribute allowed_routes.
8 9 10 |
# File 'lib/metatron/templates/gateway/listener.rb', line 8 def allowed_routes @allowed_routes end |
#hostname ⇒ Object
Returns the value of attribute hostname.
8 9 10 |
# File 'lib/metatron/templates/gateway/listener.rb', line 8 def hostname @hostname end |
#name ⇒ Object
Returns the value of attribute name.
8 9 10 |
# File 'lib/metatron/templates/gateway/listener.rb', line 8 def name @name end |
#port ⇒ Object
Returns the value of attribute port.
8 9 10 |
# File 'lib/metatron/templates/gateway/listener.rb', line 8 def port @port end |
#protocol ⇒ Object
Returns the value of attribute protocol.
8 9 10 |
# File 'lib/metatron/templates/gateway/listener.rb', line 8 def protocol @protocol end |
#tls ⇒ Object
Returns the value of attribute tls.
8 9 10 |
# File 'lib/metatron/templates/gateway/listener.rb', line 8 def tls @tls end |
Instance Method Details
#render ⇒ Object
19 20 21 22 23 24 |
# File 'lib/metatron/templates/gateway/listener.rb', line 19 def render { name:, port:, protocol: } .merge(hostname ? { hostname: } : {}) .merge(tls ? { tls: } : {}) .merge(allowed_routes ? { allowedRoutes: allowed_routes } : {}) end |