module Hashie::Extensions::Dash::IndifferentAccess::ClassMethods
Public Instance Methods
Source
# File lib/hashie/extensions/dash/indifferent_access.rb, line 34 def property?(name) name = translations[name.to_sym] if translation_for?(name) name = name.to_s !!properties.find { |property| property.to_s == name } end
Check to see if the specified property has already been defined.
Source
# File lib/hashie/extensions/dash/indifferent_access.rb, line 50 def transformation_exists?(name) name = name.to_s !!transforms.keys.find { |key| key.to_s == name } end
Source
# File lib/hashie/extensions/dash/indifferent_access.rb, line 45 def transformed_property(property_name, value) transform = transforms[property_name] || transforms[property_name.to_sym] transform.call(value) end
Source
# File lib/hashie/extensions/dash/indifferent_access.rb, line 40 def translation_exists?(name) name = name.to_s !!translations.keys.find { |key| key.to_s == name } end
Private Instance Methods
Source
# File lib/hashie/extensions/dash/indifferent_access.rb, line 57 def translation_for?(name) included_modules.include?(Hashie::Extensions::Dash::PropertyTranslation) && translation_exists?(name) end