Sha256: 6565802d244ee7863ff92e4fad45e1e527ebdc94ff2007b33ca63867ae593ff6

Contents?: true

Size: 296 Bytes

Versions: 1

Compression:

Stored size: 296 Bytes

Contents

module Predicates

  module Conversions

    def as_string
      -> (v) { v.to_s }
    end

    def as_int
      -> (v) { Type.responds(v, :to_i); v.to_i }
    end

    def as_float
      -> (v) { Type.responds(v, :to_i); v.to_f }
    end

    def as_array
      -> (v) { [v] }
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
totally_lazy-0.0.5 lib/predicates/conversions.rb