Sha256: 188397b62978cd431c748884cba88375a2b60e1c12ac004b5735089adde70608

Contents?: true

Size: 592 Bytes

Versions: 13

Compression:

Stored size: 592 Bytes

Contents

require 'volt/models/model_wrapper'

class ArrayModel < ReactiveArray
  include ModelWrapper

  def initialize(array=[], parent=nil, path=nil)
    @parent = parent
    @path = path
    
    array = wrap_values(array)
    
    super(array)
  end
  
  def attributes
    self
  end
  
  # Make sure it gets wrapped
  def <<(*args)
    args = wrap_values(args)
    
    super(*args)
  end
  
  # Make sure it gets wrapped
  def inject(*args)
    args = wrap_values(args)
    super(*args)
  end

  # Make sure it gets wrapped
  def +(*args)
    args = wrap_values(args)
    super(*args)
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
volt-0.3.7 lib/volt/models/array_model.rb
volt-0.3.6 lib/volt/models/array_model.rb
volt-0.3.5 lib/volt/models/array_model.rb
volt-0.3.4 lib/volt/models/array_model.rb
volt-0.3.3 lib/volt/models/array_model.rb
volt-0.3.2 lib/volt/models/array_model.rb
volt-0.3.1 lib/volt/models/array_model.rb
volt-0.3.0 lib/volt/models/array_model.rb
volt-0.2.9 lib/volt/models/array_model.rb
volt-0.2.7 lib/volt/models/array_model.rb
volt-0.2.5 lib/volt/models/array_model.rb
volt-0.2.4 lib/volt/models/array_model.rb
volt-0.2.3 lib/volt/models/array_model.rb