Class: Interval::Multiple

Inherits:
Interval show all
Defined in:
lib/borel/interval.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Interval

#+, #==, [], #^, #coerce, #construction, #degenerate?, #empty?, #hull, #include?, #inspect, #simple?, #to_interval, #to_s, #union, union, #|

Constructor Details

#initialize(array) ⇒ Multiple

Returns a new instance of Multiple.



193
194
195
196
# File 'lib/borel/interval.rb', line 193

def initialize(array)
  @components = array
  freeze
end

Instance Attribute Details

#componentsObject (readonly)

Returns the value of attribute components.



191
192
193
# File 'lib/borel/interval.rb', line 191

def components
  @components
end

Instance Method Details

#eachObject



198
199
200
201
# File 'lib/borel/interval.rb', line 198

def each
  components.each{|o| yield(o)}
  self
end