Class: Fractal::Map::Line
- Inherits:
-
Array
- Object
- Array
- Fractal::Map::Line
- Defined in:
- lib/fractal/map.rb
Instance Method Summary collapse
- #[](a) ⇒ Object
- #[]=(a) ⇒ Object
-
#initialize(count) ⇒ Line
constructor
A new instance of Line.
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 |