summaryrefslogtreecommitdiff
path: root/lib/hashie/dash.rb
diff options
context:
space:
mode:
authorsleverbor <rob.revels@g5searchmarketing.com>2012-03-21 20:03:28 -0700
committersleverbor <rob.revels@g5searchmarketing.com>2012-03-21 20:03:28 -0700
commit86e7e9e07b5067ac8f37fc05b30d5f9d40f28d5b (patch)
treec18df1fbd0fb15450f09d963e69352ea4df2df3a /lib/hashie/dash.rb
parentf7cb5e2b3c3ea3edd66ed2f9865eac7d7db80359 (diff)
downloadhashie-86e7e9e07b5067ac8f37fc05b30d5f9d40f28d5b.tar.gz
initialize translations before other properties in trash
Diffstat (limited to 'lib/hashie/dash.rb')
-rw-r--r--lib/hashie/dash.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/hashie/dash.rb b/lib/hashie/dash.rb
index cbfc1f5..603ec5e 100644
--- a/lib/hashie/dash.rb
+++ b/lib/hashie/dash.rb
@@ -93,9 +93,7 @@ module Hashie
self[prop] = value
end
- attributes.each_pair do |att, value|
- self[att] = value
- end if attributes
+ initialize_attributes(attributes)
assert_required_properties_set!
end
@@ -122,6 +120,12 @@ module Hashie
private
+ def initialize_attributes(attributes)
+ attributes.each_pair do |att, value|
+ self[att] = value
+ end if attributes
+ end
+
def assert_property_exists!(property)
unless self.class.property?(property)
raise NoMethodError, "The property '#{property}' is not defined for this Dash."