Class: MSFLVisitors::Nodes::Iterator

Inherits:
Base
  • Object
show all
Defined in:
lib/msfl_visitors/nodes/iterator.rb

Direct Known Subclasses

And, Or

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#accept

Constructor Details

#initialize(set) ⇒ Iterator

Be extra defensive, because even after adding previous comment I still tend to make the mistake of passing in an array.

Parameters:



12
13
14
15
16
17
# File 'lib/msfl_visitors/nodes/iterator.rb', line 12

def initialize(set)
  unless set.is_a? MSFLVisitors::Nodes::Set
    fail ArgumentError, "Argument to Iterator initialize must be instance of MSFLVisitors::Nodes::Set"
  end
  self.set = set
end

Instance Attribute Details

#setObject

Returns the value of attribute set.



6
7
8
# File 'lib/msfl_visitors/nodes/iterator.rb', line 6

def set
  @set
end

Instance Method Details

#==(other) ⇒ Object



19
20
21
22
# File 'lib/msfl_visitors/nodes/iterator.rb', line 19

def ==(other)
  self.class == other.class &&
      set == other.set
end