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.
9 10 11 12 13 |
# File 'lib/lrama/counterexamples/derivation.rb', line 9 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.
6 7 8 |
# File 'lib/lrama/counterexamples/derivation.rb', line 6 def item @item end |
#left ⇒ Object (readonly)
Returns the value of attribute left.
6 7 8 |
# File 'lib/lrama/counterexamples/derivation.rb', line 6 def left @left end |
#right ⇒ Object
Returns the value of attribute right.
6 7 8 |
# File 'lib/lrama/counterexamples/derivation.rb', line 6 def right @right end |
Instance Method Details
#render_for_report ⇒ Object
26 27 28 |
# File 'lib/lrama/counterexamples/derivation.rb', line 26 def render_for_report render_strings_for_report.join("\n") end |
#render_strings_for_report ⇒ Object
20 21 22 23 24 |
# File 'lib/lrama/counterexamples/derivation.rb', line 20 def render_strings_for_report result = [] #: Array[String] _render_for_report(self, 0, result, 0) result.map(&:rstrip) end |
#to_s ⇒ Object Also known as: inspect
15 16 17 |
# File 'lib/lrama/counterexamples/derivation.rb', line 15 def to_s "#<Derivation(#{item.display_name})>" end |