Class: TypedArray

Inherits:
Array
  • Object
show all
Defined in:
lib/simplemodel/ext/typed_array.rb

Instance Method Summary collapse

Constructor Details

#initialize(klass, *args) ⇒ TypedArray

Returns a new instance of TypedArray.



3
4
5
6
# File 'lib/simplemodel/ext/typed_array.rb', line 3

def initialize(klass, *args)
  @klass = klass
  super *args
end

Instance Method Details

#<<(elt) ⇒ Object



8
9
10
11
# File 'lib/simplemodel/ext/typed_array.rb', line 8

def <<(elt)
  check_klass(elt)
  super(elt)
end

#push(*args) ⇒ Object



13
14
15
16
# File 'lib/simplemodel/ext/typed_array.rb', line 13

def push(*args)
  check_klass(*args)
  super *args
end