Class: Fractal::Map::Line

Inherits:
Array
  • Object
show all
Defined in:
lib/fractal/map.rb

Instance Method Summary collapse

Constructor Details

#initialize(count) ⇒ Line

Returns a new instance of Line.



6
7
8
# File 'lib/fractal/map.rb', line 6

def initialize(count)
  super count, nil
end

Instance Method Details

#[](a) ⇒ Object



10
11
12
13
14
15
# File 'lib/fractal/map.rb', line 10

def [](a)
  if a.kind_of?(Numeric)
    raise "Out of bounds: #{a} / #{length}" if a < 0 || a >= length
  end
  super
end

#[]=(a) ⇒ Object



17
18
19
20
# File 'lib/fractal/map.rb', line 17

def []=(a, *)
  raise "Out of bounds: #{a} / #{length}" if a < 0 || a >= length
  super
end