Class: RubyYacht::ServerType::DSL
- Inherits:
-
Object
- Object
- RubyYacht::ServerType::DSL
- Extended by:
- DSL::Base::ClassMethods
- Includes:
- DSL::Base
- Defined in:
- lib/ruby_yacht/dsl/server_type.rb
Overview
This class provides a DSL for configuring a RubyYacht::ServerType.
Instance Method Summary collapse
-
#environment_variable(image, name, &block) ⇒ Object
This method defines a new environment variable set for this app type.
-
#initialize(name) ⇒ DSL
constructor
This initiailzer creates the server type DSL.
Methods included from DSL::Base::ClassMethods
add_attribute, add_boolean, add_generic_attribute, add_list, add_object, add_object_list, all_attributes, copied_attributes, created_type, creates_object, custom_attribute_method, default_values, required_attributes
Methods included from DSL::Base
#check_required_attributes, #create_object, #load_custom_attributes, #run
Constructor Details
#initialize(name) ⇒ DSL
This initiailzer creates the server type DSL.
### Parameters
-
**name: Symbol** The name of the server type.
70 71 72 73 74 |
# File 'lib/ruby_yacht/dsl/server_type.rb', line 70 def initialize(name) @name = name @environment_variables = [] load_custom_attributes end |
Instance Method Details
#environment_variable(image, name, &block) ⇒ Object
This method defines a new environment variable set for this app type.
### Parameters
-
**image: Symbol** The type of image this environment variable is set
for. -
**name: String** The name of the environment variable.
-
block A block for generating the environment variable.
This will have access to the project (as @project) and the server (as @server) that we are building the image for.
117 118 119 |
# File 'lib/ruby_yacht/dsl/server_type.rb', line 117 def environment_variable(image, name, &block) @environment_variables << {image: image, name: name, block: block} end |