module R18n::YamlMethods
Base methods to load translations for YAML. It is used by YAML and Rails loaders.
Public Instance Methods
detect_yaml_private_type()
click to toggle source
Detect class for private type depend on YAML parser.
# File lib/r18n-core/yaml_methods.rb, line 27 def detect_yaml_private_type @private_type_class = if defined?(Syck) ::Syck::PrivateType end end
initialize_types()
click to toggle source
Register global types in Psych
# File lib/r18n-core/yaml_methods.rb, line 34 def initialize_types if defined?(Psych) Filters.by_type.keys.each do |type| next unless type.is_a? String # Yeah, I add R18n’s types to global, send me patch if you really # use YAML types too ;). Psych.add_domain_type('yaml.org,2002', type) do |full_type, value| Typed.new(type, value) end end end end