diff options
author | sleverbor <rob.revels@g5searchmarketing.com> | 2012-03-21 20:03:28 -0700 |
---|---|---|
committer | sleverbor <rob.revels@g5searchmarketing.com> | 2012-03-21 20:03:28 -0700 |
commit | 86e7e9e07b5067ac8f37fc05b30d5f9d40f28d5b (patch) | |
tree | c18df1fbd0fb15450f09d963e69352ea4df2df3a /lib/hashie/dash.rb | |
parent | f7cb5e2b3c3ea3edd66ed2f9865eac7d7db80359 (diff) | |
download | hashie-86e7e9e07b5067ac8f37fc05b30d5f9d40f28d5b.tar.gz |
initialize translations before other properties in trash
Diffstat (limited to 'lib/hashie/dash.rb')
-rw-r--r-- | lib/hashie/dash.rb | 10 |
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." |