Module: Cumuliform::DSL::Import
- Included in:
- Template
- Defined in:
- lib/cumuliform/dsl/import.rb
Overview
DSL methods for importing other templates
Instance Method Summary collapse
- #has_logical_id?(logical_id) ⇒ Boolean private
-
#import(template) ⇒ Object
Import another Cumuliform::Template into this one.
- #verify_logical_id!(logical_id) ⇒ Object private
Instance Method Details
#has_logical_id?(logical_id) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
15 16 17 18 19 |
# File 'lib/cumuliform/dsl/import.rb', line 15 def has_logical_id?(logical_id) (imports.reverse).inject(logical_ids.include?(logical_id)) { |found, template| found || template.has_logical_id?(logical_id) } end |
#import(template) ⇒ Object
Import another Cumuliform::Template into this one
10 11 12 |
# File 'lib/cumuliform/dsl/import.rb', line 10 def import(template) imports << template end |
#verify_logical_id!(logical_id) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
22 23 24 25 |
# File 'lib/cumuliform/dsl/import.rb', line 22 def verify_logical_id!(logical_id) raise Error::NoSuchLogicalId, logical_id unless has_logical_id?(logical_id) true end |