Class: DTK::DSL::Template::V1::ModuleRef
- Inherits:
-
DTK::DSL::Template::V1
- Object
- DTK::DSL::Template
- DTK::DSL::Template::V1
- DTK::DSL::Template::V1::ModuleRef
- Defined in:
- lib/dsl/template/v1/module_ref.rb
Constant Summary collapse
- MODULE_NAMESPACE_DELIMS =
['/', ':']
Constants inherited from DTK::DSL::Template::V1
Instance Attribute Summary
Attributes included from NestedDSLFile::Mixin
Attributes included from Generation::Mixin
Attributes included from Parsing::Mixin
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from DTK::DSL::Template::V1
#dsl_version, #template_version
Methods inherited from DTK::DSL::Template
#add, create_for_generation, create_for_parsing, #initialize, #merge, #req, #set, #set?, #val
Methods included from Parsing::ClassMixin
#elements_collection_type, #file_parser_output_array, #file_parser_output_hash, #parse_element, #parse_elements
Methods included from Generation::ClassMixin
Methods included from Generation::Mixin
#generate!, #generate?, #generate_yaml_file_path__content_array, #generate_yaml_object, #generate_yaml_object?, #generate_yaml_text, #yaml_object_type
Methods included from Parsing::Mixin
Constructor Details
This class inherits a constructor from DTK::DSL::Template
Class Method Details
.elements_collection_type ⇒ Object
28 29 30 |
# File 'lib/dsl/template/v1/module_ref.rb', line 28 def self.elements_collection_type :array end |
.parse_elements(input_array, parent_info) ⇒ Object
32 33 34 35 36 37 38 |
# File 'lib/dsl/template/v1/module_ref.rb', line 32 def self.parse_elements(input_array, parent_info) ret = file_parser_output_array input_array.each_with_index do |module_ref, i| ret << parse_element(module_ref, parent_info, :index => i) end ret end |
Instance Method Details
#parse! ⇒ Object
40 41 42 43 44 45 46 47 48 |
# File 'lib/dsl/template/v1/module_ref.rb', line 40 def parse! split = split_by_delim(input_string) unless split.size == 2 raise parsing_error("The term '#{input_string}' is an ill-formed module reference") end namespace, module_name = split set :Namespace, namespace set :ModuleName, module_name end |
#parser_output_type ⇒ Object
24 25 26 |
# File 'lib/dsl/template/v1/module_ref.rb', line 24 def parser_output_type :hash end |