Sha256: b08e152fb419e28c1f67029e852ee01f95af1f1d728c36729be928529460c8a3

Contents?: true

Size: 467 Bytes

Versions: 64

Compression:

Stored size: 467 Bytes

Contents

class Rack::App::Utils::Parser::Numeric
  def parse(str)
    case true
    when int_parser.validate(str)
      int_parser.parse(str)
    when float_parser.validate(str)
      float_parser.parse(str)
    else
      str
    end
  end

  def validate(str)
    int_parser.validate(str) || float_parser.validate(str)
  end

  protected

  def int_parser
    Rack::App::Utils::Parser::Integer.new
  end

  def float_parser
    Rack::App::Utils::Parser::Float.new
  end
end

Version data entries

64 entries across 64 versions & 2 rubygems

Version Path
rack-app-7.3.2 lib/rack/app/utils/parser/numeric.rb
rack-app-7.3.1 lib/rack/app/utils/parser/numeric.rb
rack-app-7.3.0 lib/rack/app/utils/parser/numeric.rb
rack-app-7.2.2 lib/rack/app/utils/parser/numeric.rb
rack-app-7.2.1 lib/rack/app/utils/parser/numeric.rb
rack-app-7.2.0 lib/rack/app/utils/parser/numeric.rb
rack-app-7.1.0 lib/rack/app/utils/parser/numeric.rb
rack-app-7.0.0 lib/rack/app/utils/parser/numeric.rb
rack-app-6.8.0 lib/rack/app/utils/parser/numeric.rb
rack-app-6.7.1 lib/rack/app/utils/parser/numeric.rb
rack-app-6.7.0 lib/rack/app/utils/parser/numeric.rb
rack-app-6.6.0 lib/rack/app/utils/parser/numeric.rb
rack-app-6.5.0 lib/rack/app/utils/parser/numeric.rb
rack-app-6.4.1 lib/rack/app/utils/parser/numeric.rb
rack-app-6.4.0 lib/rack/app/utils/parser/numeric.rb
rack-app-6.3.3 lib/rack/app/utils/parser/numeric.rb
rack-app-6.3.2 lib/rack/app/utils/parser/numeric.rb
rack-app-6.3.1 lib/rack/app/utils/parser/numeric.rb
rack-app-6.3.0 lib/rack/app/utils/parser/numeric.rb
rack-app-6.2.0 lib/rack/app/utils/parser/numeric.rb