Class: AbstractSynthesizer

Inherits:
Object
  • Object
show all
Includes:
Bury
Defined in:
lib/abstract-synthesizer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Bury

add_bury_to_hash

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_dataObject (readonly)

Returns the value of attribute context_data.



9
10
11
# File 'lib/abstract-synthesizer.rb', line 9

def context_data
  @context_data
end

#translationObject (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

#manifestObject



36
37
38
# File 'lib/abstract-synthesizer.rb', line 36

def manifest
  @translation[:manifest]
end

#synthesisObject



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