Class: Proforma::Modeling::Text

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Compiling::Compilable
Defined in:
lib/proforma/modeling/text.rb

Overview

Emit and render basic text against a record.

Direct Known Subclasses

Header

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value: '') ⇒ Text

Returns a new instance of Text.



22
23
24
# File 'lib/proforma/modeling/text.rb', line 22

def initialize(value: '')
  @value = value
end

Instance Attribute Details

#valueObject



26
27
28
# File 'lib/proforma/modeling/text.rb', line 26

def value
  @value.to_s
end

Instance Method Details

#compile(data, evaluator) ⇒ Object



30
31
32
33
34
# File 'lib/proforma/modeling/text.rb', line 30

def compile(data, evaluator)
  self.class.new(
    value: evaluator.text(data, value)
  )
end