summaryrefslogtreecommitdiff
path: root/lib/psych/visitors
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@ruby-lang.org>2022-01-21 17:00:36 -0800
committerGitHub <noreply@github.com>2022-01-21 17:00:36 -0800
commit47d4a6a5b540515268b59bed995924831948289f (patch)
tree53f9308aa84f782bce7bddc651046f3a3309555e /lib/psych/visitors
parentc40ce47e77de42f444b4ae4928ccc520385f822f (diff)
parent75bebb37b80c7c3f3c6a157e1dd25112cfae8029 (diff)
downloadpsych-47d4a6a5b540515268b59bed995924831948289f.tar.gz
Merge pull request #537 from sethboyles/strict_integer_option
Add strict_integer option to parse numbers with commas as strings
Diffstat (limited to 'lib/psych/visitors')
-rw-r--r--lib/psych/visitors/to_ruby.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/psych/visitors/to_ruby.rb b/lib/psych/visitors/to_ruby.rb
index 4c1f561..935bc74 100644
--- a/lib/psych/visitors/to_ruby.rb
+++ b/lib/psych/visitors/to_ruby.rb
@@ -12,9 +12,9 @@ module Psych
###
# This class walks a YAML AST, converting each node to Ruby
class ToRuby < Psych::Visitors::Visitor
- def self.create(symbolize_names: false, freeze: false)
+ def self.create(symbolize_names: false, freeze: false, strict_integer: false)
class_loader = ClassLoader.new
- scanner = ScalarScanner.new class_loader
+ scanner = ScalarScanner.new class_loader, strict_integer: strict_integer
new(scanner, class_loader, symbolize_names: symbolize_names, freeze: freeze)
end