lib/hashme/casted_array.rb in hashme-0.1.2 vs lib/hashme/casted_array.rb in hashme-0.2.0
- old
+ new
@@ -18,11 +18,11 @@
:each, :reject, :empty?, :map,
:clear, :pop, :shift, :delete, :delete_at,
:encode_json, :as_json, :to_json,
:inspect, :any?
- def initialize(owner, property, values = [])
+ def initialize(property, owner, values = [])
@_array = []
self.casted_by = owner
self.casted_by_property = property
if values.respond_to?(:each)
values.each do |value|
@@ -52,10 +52,10 @@
end
protected
def instantiate_and_build(obj)
- casted_by_property.build(casted_by, obj)
+ casted_by_property.build(self, obj)
end
end
end