Sha256: 6e38db4516bf545c8f27271a83b9a0321ad1515f9d3b02e257c3e54f0c2c0b80

Contents?: true

Size: 344 Bytes

Versions: 64

Compression:

Stored size: 344 Bytes

Contents

class Rack::App::Utils::Parser::Boolean
  def parse(str)
    case true

    when true?(str)
      true

    when false?(str)
      false

    else
      str

    end
  end

  def validate(str)
    false?(str) || true?(str)
  end

  protected

  def false?(obj)
    !!(obj =~ /^false$/)
  end

  def true?(obj)
    !!(obj =~ /^true$/)
  end
end

Version data entries

64 entries across 64 versions & 2 rubygems

Version Path
rack-app-11.0.2 lib/rack/app/utils/parser/boolean.rb
rack-app-11.0.1 lib/rack/app/utils/parser/boolean.rb
rack-app-11.0.0 lib/rack/app/utils/parser/boolean.rb
rack-app-10.0.0 lib/rack/app/utils/parser/boolean.rb
rack-app-9.0.0 lib/rack/app/utils/parser/boolean.rb
rack-app-8.1.0 lib/rack/app/utils/parser/boolean.rb
rack-app-8.0.1 lib/rack/app/utils/parser/boolean.rb
rack-app-8.0.0 lib/rack/app/utils/parser/boolean.rb
mountapi-0.11.1 vendor/bundle/ruby/2.7.0/gems/rack-app-7.7.0/lib/rack/app/utils/parser/boolean.rb
rack-app-7.7.0 lib/rack/app/utils/parser/boolean.rb
rack-app-7.6.5 lib/rack/app/utils/parser/boolean.rb
rack-app-7.6.4 lib/rack/app/utils/parser/boolean.rb
rack-app-7.6.3 lib/rack/app/utils/parser/boolean.rb
rack-app-7.6.2 lib/rack/app/utils/parser/boolean.rb
rack-app-7.6.1 lib/rack/app/utils/parser/boolean.rb
rack-app-7.6.0 lib/rack/app/utils/parser/boolean.rb
rack-app-7.5.2 lib/rack/app/utils/parser/boolean.rb
rack-app-7.5.1 lib/rack/app/utils/parser/boolean.rb
rack-app-7.5.0 lib/rack/app/utils/parser/boolean.rb
rack-app-7.4.0 lib/rack/app/utils/parser/boolean.rb