Class: Interscript::Node::Tests
- Inherits:
-
Interscript::Node
- Object
- Interscript::Node
- Interscript::Node::Tests
- Defined in:
- lib/interscript/node/tests.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
Instance Method Summary collapse
- #<<(pair) ⇒ Object
- #==(other) ⇒ Object
-
#initialize(data = []) ⇒ Tests
constructor
A new instance of Tests.
- #reverse ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(data = []) ⇒ Tests
Returns a new instance of Tests.
3 4 5 |
# File 'lib/interscript/node/tests.rb', line 3 def initialize data=[] @data = data end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
2 3 4 |
# File 'lib/interscript/node/tests.rb', line 2 def data @data end |
Instance Method Details
#<<(pair) ⇒ Object
7 8 9 |
# File 'lib/interscript/node/tests.rb', line 7 def <<(pair) @data << pair end |
#==(other) ⇒ Object
17 18 19 |
# File 'lib/interscript/node/tests.rb', line 17 def ==(other) super && self.data == other.data end |
#reverse ⇒ Object
11 12 13 14 15 |
# File 'lib/interscript/node/tests.rb', line 11 def reverse self.class.new(data.map do |from,to,reverse_run| [to, from, reverse_run == nil ? nil : !reverse_run] end) end |
#to_hash ⇒ Object
21 22 23 24 |
# File 'lib/interscript/node/tests.rb', line 21 def to_hash { :class => self.class.to_s, :data => @data } end |