Class: Loom::Pattern::ReferenceSet::Builder
- Inherits:
-
Object
- Object
- Loom::Pattern::ReferenceSet::Builder
- Defined in:
- lib/loom/pattern/reference_set.rb
Class Method Summary collapse
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(shell_module, source) ⇒ Builder
constructor
A new instance of Builder.
Constructor Details
#initialize(shell_module, source) ⇒ Builder
Returns a new instance of Builder.
64 65 66 67 68 |
# File 'lib/loom/pattern/reference_set.rb', line 64 def initialize(shell_module, source) @shell_module = shell_module @pattern_mod_specs = pattern_mod_specs @source = source end |
Class Method Details
.create(ruby_code, source) ⇒ Object
54 55 56 57 58 59 60 61 |
# File 'lib/loom/pattern/reference_set.rb', line 54 def create(ruby_code, source) shell_module = Module.new shell_module.include Loom::Pattern shell_module.module_eval ruby_code, source, 1 shell_module.namespace "" self.new(shell_module, source).build end |
Instance Method Details
#build ⇒ Object
70 71 72 73 74 |
# File 'lib/loom/pattern/reference_set.rb', line 70 def build ref_set = ReferenceSet.new ref_set.add_pattern_refs pattern_refs ref_set end |