Class: SafeYAML::Transform::ToSymbol
- Inherits:
-
Object
- Object
- SafeYAML::Transform::ToSymbol
- Defined in:
- lib/safe_yaml/transform/to_symbol.rb
Instance Method Summary collapse
Instance Method Details
#transform?(value, options = SafeYAML::OPTIONS) ⇒ Boolean
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/safe_yaml/transform/to_symbol.rb', line 4 def transform?(value, =SafeYAML::OPTIONS) if [:deserialize_symbols] && value =~ /\A:./ if value =~ /\A:(["'])(.*)\1\Z/ return true, $2.sub(/^:/, "").to_sym else return true, value.sub(/^:/, "").to_sym end end return false end |