Parent

SafeYAML::Transform::ToInteger

Constants

MATCHERS

Public Instance Methods

transform?(value) click to toggle source
# File lib/safe_yaml/transform/to_integer.rb, line 11
def transform?(value)
  MATCHERS.each do |matcher|
    return true, Integer(value) if matcher.match(value)
  end
  try_edge_cases?(value)
end
try_edge_cases?(value) click to toggle source
# File lib/safe_yaml/transform/to_integer.rb, line 18
def try_edge_cases?(value)
  return true, Parse::Hexadecimal.value(value) if Parse::Hexadecimal::MATCHER.match(value)
  return true, Parse::Sexagesimal.value(value) if Parse::Sexagesimal::INTEGER_MATCHER.match(value)
  return false
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.