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, NewtonOptions, PI

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Interval

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

Constructor Details

#initialize(array) ⇒ Multiple

:nodoc:



739
740
741
742
# File 'lib/interval.rb', line 739

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

Instance Attribute Details

#componentsObject (readonly)

The array with the interval’s components.



737
738
739
# File 'lib/interval.rb', line 737

def components
  @components
end

Instance Method Details

#eachObject

Implements Enumerable#each.



745
746
747
748
# File 'lib/interval.rb', line 745

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