lib/amsi/model/base.rb in amsi-1.0.1 vs lib/amsi/model/base.rb in amsi-1.1.0
- old
+ new
@@ -47,14 +47,15 @@
# Initialize a new model with the response hash from AMSI. Attribute
# values are parsed into their configured data types.
#
# @param attrs [Hash<String, Object>] the response hash from AMSI.
# Attribute keys are case insensitive.
- def initialize(attrs = {})
+ def initialize(attrs = {}, timezone = nil)
attrs.each do |attr, value|
attribute = self.class.attribute_store.find(attr)
next unless attribute
- parser = AttributeParser.new(value: value, type: attribute.type)
+
+ parser = AttributeParser.new(value: value, type: attribute.type, timezone: timezone)
instance_variable_set("@#{attribute.name}", parser.parse)
end
end
end