Class: Lrama::Counterexamples::Derivation
- Inherits:
-
Object
- Object
- Lrama::Counterexamples::Derivation
- Defined in:
- lib/lrama/counterexamples/derivation.rb
Instance Attribute Summary collapse
-
#item ⇒ Object
readonly
Returns the value of attribute item.
-
#left ⇒ Object
readonly
Returns the value of attribute left.
-
#right ⇒ Object
Returns the value of attribute right.
Instance Method Summary collapse
-
#initialize(item, left, right = nil) ⇒ Derivation
constructor
A new instance of Derivation.
- #render_for_report ⇒ Object
- #render_strings_for_report ⇒ Object
- #to_s ⇒ Object (also: #inspect)
Constructor Details
#initialize(item, left, right = nil) ⇒ Derivation
Returns a new instance of Derivation.
7 8 9 10 11 |
# File 'lib/lrama/counterexamples/derivation.rb', line 7 def initialize(item, left, right = nil) @item = item @left = left @right = right end |
Instance Attribute Details
#item ⇒ Object (readonly)
Returns the value of attribute item.
4 5 6 |
# File 'lib/lrama/counterexamples/derivation.rb', line 4 def item @item end |
#left ⇒ Object (readonly)
Returns the value of attribute left.
4 5 6 |
# File 'lib/lrama/counterexamples/derivation.rb', line 4 def left @left end |
#right ⇒ Object
Returns the value of attribute right.
4 5 6 |
# File 'lib/lrama/counterexamples/derivation.rb', line 4 def right @right end |
Instance Method Details
#render_for_report ⇒ Object
24 25 26 |
# File 'lib/lrama/counterexamples/derivation.rb', line 24 def render_for_report render_strings_for_report.join("\n") end |
#render_strings_for_report ⇒ Object
18 19 20 21 22 |
# File 'lib/lrama/counterexamples/derivation.rb', line 18 def render_strings_for_report result = [] _render_for_report(self, 0, result, 0) result.map(&:rstrip) end |
#to_s ⇒ Object Also known as: inspect
13 14 15 |
# File 'lib/lrama/counterexamples/derivation.rb', line 13 def to_s "#<Derivation(#{item.display_name})>" end |