Class: Interval::Multiple

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

Overview

Implements an interval with multiple components.

Constant Summary

Constants inherited from Interval

E, PI

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Interval

#&, #*, #**, #+, #-, #-@, #/, #==, [], #atan, #coerce, #construction, #cos, #cosh, #empty?, #exp, #hull, #include?, #inspect, #inverse, #log, make, #newton, #op, #sharp?, #simple?, #sin, #sinh, #tan, #to_interval, #to_s, #|

Constructor Details

#initialize(array) ⇒ Multiple

:nodoc:



683
684
685
686
# File 'lib/interval.rb', line 683

def initialize (array)  # :nodoc:
  @components = array
  freeze
end

Instance Attribute Details

#componentsObject (readonly)

The array with the interval’s components.



681
682
683
# File 'lib/interval.rb', line 681

def components
  @components
end

Instance Method Details

#eachObject

Implements Enumerable#each.



689
690
691
692
# File 'lib/interval.rb', line 689

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