Sha256: 98464239d1747bb326d2f03dcabfb65501570e8ad27a23c57d4495409f78664b

Contents?: true

Size: 265 Bytes

Versions: 1

Compression:

Stored size: 265 Bytes

Contents

require 'date'

module Transproc
  register(:to_string) do |value|
    value.to_s
  end

  register(:to_integer) do |value|
    value.to_i
  end

  register(:to_float) do |value|
    value.to_f
  end

  register(:to_date) do |value|
    Date.parse(value)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
transproc-0.0.1 lib/transproc/coercions.rb