Class: Kuby::Definition
- Inherits:
-
Object
- Object
- Kuby::Definition
- Defined in:
- lib/kuby/definition.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
Instance Method Summary collapse
- #app_name ⇒ Object
- #docker(&block) ⇒ Object
-
#initialize(environment, app, &block) ⇒ Definition
constructor
A new instance of Definition.
- #kubernetes(&block) ⇒ Object
Constructor Details
#initialize(environment, app, &block) ⇒ Definition
Returns a new instance of Definition.
5 6 7 8 9 10 11 |
# File 'lib/kuby/definition.rb', line 5 def initialize(environment, app, &block) @environment = environment @app = app instance_eval(&block) if block kubernetes.after_configuration end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
3 4 5 |
# File 'lib/kuby/definition.rb', line 3 def app @app end |
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
3 4 5 |
# File 'lib/kuby/definition.rb', line 3 def environment @environment end |
Instance Method Details
#app_name ⇒ Object
25 26 27 |
# File 'lib/kuby/definition.rb', line 25 def app_name @app_name ||= app.class.module_parent.name end |
#docker(&block) ⇒ Object
13 14 15 16 17 |
# File 'lib/kuby/definition.rb', line 13 def docker(&block) @docker ||= Docker::Spec.new(self) @docker.instance_eval(&block) if block @docker end |
#kubernetes(&block) ⇒ Object
19 20 21 22 23 |
# File 'lib/kuby/definition.rb', line 19 def kubernetes(&block) @kubernetes ||= Kubernetes::Spec.new(self) @kubernetes.instance_eval(&block) if block @kubernetes end |