Skip to content

Commit 0927af9

Browse files
Rename method to keep it consistent with others _parse_* versions
Follow-up of 46c41db.
1 parent 46c41db commit 0927af9

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

activesupport/lib/active_support/xml_mini.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def content_type
7979
"string" => Proc.new { |string| string.to_s },
8080
"yaml" => Proc.new { |yaml| YAML.load(yaml) rescue yaml },
8181
"base64Binary" => Proc.new { |bin| ::Base64.decode64(bin) },
82-
"hexBinary" => Proc.new { |bin| parse_hex_binary(bin) },
82+
"hexBinary" => Proc.new { |bin| _parse_hex_binary(bin) },
8383
"binary" => Proc.new { |bin, entity| _parse_binary(bin, entity) },
8484
"file" => Proc.new { |file, entity| _parse_file(file, entity) }
8585
}
@@ -168,7 +168,7 @@ def _parse_binary(bin, entity)
168168
when "base64"
169169
::Base64.decode64(bin)
170170
when "hex", "hexBinary"
171-
parse_hex_binary(bin)
171+
_parse_hex_binary(bin)
172172
else
173173
bin
174174
end
@@ -182,7 +182,7 @@ def _parse_file(file, entity)
182182
f
183183
end
184184

185-
def parse_hex_binary(bin)
185+
def _parse_hex_binary(bin)
186186
[bin].pack("H*")
187187
end
188188

activesupport/test/xml_mini_test.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,11 +338,10 @@ def test_yaml
338338
end
339339

340340
def test_hexBinary
341-
parser = @parsing["hexBinary"]
342-
343341
expected = "Hello, World!"
344342
hex_binary = "48656C6C6F2C20576F726C6421"
345343

344+
parser = @parsing["hexBinary"]
346345
assert_equal expected, parser.call(hex_binary)
347346

348347
parser = @parsing["binary"]

0 commit comments

Comments
 (0)