Module: ActiveSupport::CoreExtensions::Hash::Conversions::ClassMethods

Defined in:
lib/active_support/core_ext/hash/conversions.rb

Instance Method Summary collapse

Instance Method Details

#create_from_xml(xml) ⇒ Object



92
93
94
95
# File 'lib/active_support/core_ext/hash/conversions.rb', line 92

def create_from_xml(xml)
  ActiveSupport::Deprecation.warn("Hash.create_from_xml has been renamed to Hash.from_xml", caller)
  from_xml(xml)
end

#from_xml(xml) ⇒ Object



82
83
84
85
86
87
88
89
90
# File 'lib/active_support/core_ext/hash/conversions.rb', line 82

def from_xml(xml)
  # TODO: Refactor this into something much cleaner that doesn't rely on XmlSimple
  undasherize_keys(typecast_xml_value(XmlSimple.xml_in(xml,
    'forcearray'   => false,
    'forcecontent' => true,
    'keeproot'     => true,
    'contentkey'   => '__content__')
  ))            
end