Class: AbstractSynthesizer
- Inherits:
-
Object
- Object
- AbstractSynthesizer
- Includes:
- Bury
- Defined in:
- lib/abstract-synthesizer.rb
Instance Attribute Summary collapse
-
#context_data ⇒ Object
readonly
Returns the value of attribute context_data.
-
#translation ⇒ Object
readonly
Returns the value of attribute translation.
Instance Method Summary collapse
- #clear! ⇒ Object
-
#initialize(name: nil) ⇒ AbstractSynthesizer
constructor
rubocop:disable Lint/UnusedMethodArgument.
- #manifest ⇒ Object
- #synthesis ⇒ Object
- #synthesize(content = nil, &block) ⇒ Object
Methods included from Bury
Constructor Details
#initialize(name: nil) ⇒ AbstractSynthesizer
rubocop:disable Lint/UnusedMethodArgument
11 12 13 14 15 16 17 |
# File 'lib/abstract-synthesizer.rb', line 11 def initialize(name: nil) # rubocop:disable Lint/UnusedMethodArgument @translation = { ancestors: [], manifest: {}, context: nil } end |
Instance Attribute Details
#context_data ⇒ Object (readonly)
Returns the value of attribute context_data.
9 10 11 |
# File 'lib/abstract-synthesizer.rb', line 9 def context_data @context_data end |
#translation ⇒ Object (readonly)
Returns the value of attribute translation.
9 10 11 |
# File 'lib/abstract-synthesizer.rb', line 9 def translation @translation end |
Instance Method Details
#clear! ⇒ Object
19 20 21 |
# File 'lib/abstract-synthesizer.rb', line 19 def clear! translation[:manifest] = {} end |
#manifest ⇒ Object
36 37 38 |
# File 'lib/abstract-synthesizer.rb', line 36 def manifest @translation[:manifest] end |
#synthesis ⇒ Object
23 24 25 |
# File 'lib/abstract-synthesizer.rb', line 23 def synthesis translation[:manifest] end |
#synthesize(content = nil, &block) ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/abstract-synthesizer.rb', line 27 def synthesize(content = nil, &block) if block_given? instance_eval(&block) else instance_eval(content) end self end |