Class: CouchRest::CastedArray

Inherits:
Array
  • Object
show all
Defined in:
lib/couchrest/casted_array.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(array, property) ⇒ CastedArray



11
12
13
14
# File 'lib/couchrest/casted_array.rb', line 11

def initialize(array, property)
  self.property = property
  super(array)
end

Instance Attribute Details

#casted_byObject

Returns the value of attribute casted_by



8
9
10
# File 'lib/couchrest/casted_array.rb', line 8

def casted_by
  @casted_by
end

#propertyObject

Returns the value of attribute property



9
10
11
# File 'lib/couchrest/casted_array.rb', line 9

def property
  @property
end

Instance Method Details

#<<(obj) ⇒ Object



16
17
18
# File 'lib/couchrest/casted_array.rb', line 16

def << obj
  super(instantiate_and_cast(obj))
end

#[]=(index, obj) ⇒ Object



24
25
26
# File 'lib/couchrest/casted_array.rb', line 24

def []= index, obj
  super(index, instantiate_and_cast(obj))
end

#push(obj) ⇒ Object



20
21
22
# File 'lib/couchrest/casted_array.rb', line 20

def push(obj)
  super(instantiate_and_cast(obj))
end