Sha256: 4cb073d356dfa01ec4662c870eafea87c29379717fa20a4a427b9c0eaa476959

Contents?: true

Size: 347 Bytes

Versions: 9

Compression:

Stored size: 347 Bytes

Contents

module Goliath
  module Rack
    module Types
      CORE_TYPES = [Integer, Float]

      CORE_TYPES.each do |type|
        klass = Class.new(Base)
        klass.class_eval <<-EOT, __FILE__, __LINE__ + 1
          def _coerce(val)
            #{type}(val)
          end
        EOT

        const_set(type.name, klass)
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
goliath-1.0.7 lib/goliath/rack/types/core.rb
goliath-1.0.6 lib/goliath/rack/types/core.rb
goliath-1.0.5 lib/goliath/rack/types/core.rb
goliath-1.0.4 lib/goliath/rack/types/core.rb
goliath-1.0.3 lib/goliath/rack/types/core.rb
goliath-1.0.2 lib/goliath/rack/types/core.rb
goliath-1.0.1 lib/goliath/rack/types/core.rb
goliath-1.0.0 lib/goliath/rack/types/core.rb
goliath-1.0.0.beta.1 lib/goliath/rack/types/core.rb