Class: Kuby::Environment
- Inherits:
-
Object
- Object
- Kuby::Environment
- Defined in:
- lib/kuby/environment.rb
Instance Attribute Summary collapse
-
#configured ⇒ Object
(also: #configured?)
Returns the value of attribute configured.
-
#definition ⇒ Object
readonly
Returns the value of attribute definition.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #app_name ⇒ Object
- #development? ⇒ Boolean
- #docker(&block) ⇒ Object
-
#initialize(name, definition, &block) ⇒ Environment
constructor
A new instance of Environment.
- #kubernetes(&block) ⇒ Object
Constructor Details
#initialize(name, definition, &block) ⇒ Environment
Returns a new instance of Environment.
9 10 11 12 |
# File 'lib/kuby/environment.rb', line 9 def initialize(name, definition, &block) @name = name @definition = definition end |
Instance Attribute Details
#configured ⇒ Object Also known as: configured?
Returns the value of attribute configured.
5 6 7 |
# File 'lib/kuby/environment.rb', line 5 def configured @configured end |
#definition ⇒ Object (readonly)
Returns the value of attribute definition.
4 5 6 |
# File 'lib/kuby/environment.rb', line 4 def definition @definition end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/kuby/environment.rb', line 4 def name @name end |
Instance Method Details
#app_name ⇒ Object
31 32 33 |
# File 'lib/kuby/environment.rb', line 31 def app_name definition.app_name end |
#development? ⇒ Boolean
35 36 37 |
# File 'lib/kuby/environment.rb', line 35 def development? name == 'development' end |
#docker(&block) ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/kuby/environment.rb', line 14 def docker(&block) @docker ||= if development? Docker::DevSpec.new(self) else Docker::Spec.new(self) end @docker.instance_eval(&block) if block @docker end |
#kubernetes(&block) ⇒ Object
25 26 27 28 29 |
# File 'lib/kuby/environment.rb', line 25 def kubernetes(&block) @kubernetes ||= Kubernetes::Spec.new(self) @kubernetes.instance_eval(&block) if block @kubernetes end |