File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -105,10 +105,10 @@ module ActiveResource
105105 # To customize how attributes are encoded and decoded, declare a format and override
106106 # its +encode+ and +decode+ methods:
107107 #
108- # module CamelcaseJsonFormat
109- # extend ActiveResource::Formats[:json]
108+ # class CamelcaseJsonFormat
109+ # include ActiveResource::Formats[:json]
110110 #
111- # def self. encode(resource, options = nil)
111+ # def encode(resource, options = nil)
112112 # hash = resource.as_json(options)
113113 # hash = hash.deep_transform_keys! { |key| key.camelcase(:lower) }
114114 # super(hash)
@@ -120,7 +120,7 @@ module ActiveResource
120120 # end
121121 # end
122122 #
123- # Person.format = CamelcaseJsonFormat
123+ # Person.format = CamelcaseJsonFormat.new
124124 #
125125 # person = Person.new(first_name: "First", last_name: "Last")
126126 # person.encode
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ class AddressXMLFormatter
55 include ActiveResource ::Formats ::XmlFormat
66
77 def decode ( xml )
8- data = ActiveResource :: Formats :: XmlFormat . decode ( xml )
8+ data = super
99 # process address fields
1010 data . each do |address |
1111 address [ "city_state" ] = "#{ address [ 'city' ] } , #{ address [ 'state' ] } "
You can’t perform that action at this time.
0 commit comments