Class: Kitsune::Kit::Configuration::Service
- Inherits:
-
Object
- Object
- Kitsune::Kit::Configuration::Service
- Defined in:
- lib/kitsune/kit/configuration.rb
Instance Method Summary collapse
-
#initialize(**attributes) ⇒ Service
constructor
A new instance of Service.
Constructor Details
#initialize(**attributes) ⇒ Service
Returns a new instance of Service.
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/kitsune/kit/configuration.rb', line 68 def initialize(**attributes) super( enabled: boolean(attributes.fetch(:enabled)), mode: attributes.fetch(:mode, "managed").to_s, host: attributes[:host]&.to_s, image: attributes.fetch(:image).to_s, publish: boolean(attributes.fetch(:publish)), bind: attributes.fetch(:bind).to_s, allowed_cidrs: Array(attributes.fetch(:allowed_cidrs)).map(&:to_s).freeze, port: Integer(attributes.fetch(:port)), password_env: attributes.fetch(:password_env).to_s, compose: attributes.fetch(:compose, Compose.new) ) rescue ArgumentError, TypeError raise Errors::ConfigurationError, "service port must be an integer" end |