class Object

Extensions to Object needed to support flex array.

Public Instance Methods

to_index_range(spec) click to toggle source

Convert this object to an range index against the spec.

# File lib/flex_array/object.rb, line 10
def to_index_range(spec)
  if self == :all
    spec.range
  else
    fail IndexError, "Invalid subscript: #{self.inspect}"
  end
end
to_spec_component(_stride) click to toggle source

Fail with message since the array dimension is invalid.

# File lib/flex_array/object.rb, line 5
def to_spec_component(_stride)
  fail ArgumentError, "Invalid flex array dimension: #{self.inspect}"
end