class Gecode::EnumerableView

Describes an immutable view of an enumerable.

Attributes

max[R]

Gets the maximum element of the view.

min[R]

Gets the minimum element of the view.

size[R]

Gets the number of elements in the view.

Public Instance Methods

each(&block) click to toggle source

Iterates over every element in the view.

# File doc/tmp/rdoc_dev/gecoder/interface/variables.rb, line 291
def each(&block)
  enum.each(&block)
end

Public Class Methods

new(min, max, size, &enum_constructor) click to toggle source

Constructs a view with the specified minimum, maximum and size. The block should construct an enumerable containing the elements of the set.

# File doc/tmp/rdoc_dev/gecoder/interface/variables.rb, line 282
def initialize(min, max, size, &enum_constructor)
  @min = min
  @max = max
  @size = size
  @constructor = enum_constructor
  @enum = nil
end