Sha256: 070b763638343b2703967848781fbbc6a472fd1e98941333e15014134f5a5024

Contents?: true

Size: 258 Bytes

Versions: 15

Compression:

Stored size: 258 Bytes

Contents

require 'myrrha/with_core_ext'
require 'myrrha/coerce'
require 'date'

values = ["12", "true", "2011-07-20"]
types  = [Integer, Boolean, Date]
values.zip(types).collect do |value,domain|
  coerce(value, domain)
end
# => [12, true, #<Date: 2011-07-20 (...)>]

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
myrrha-3.1.0 examples/coerce_intro.rb
myrrha-3.0.0 examples/coerce_intro.rb
myrrha-3.0.0.rc7 examples/coerce_intro.rb
myrrha-3.0.0.rc6 examples/coerce_intro.rb
myrrha-3.0.0.rc5 examples/coerce_intro.rb
myrrha-3.0.0.rc4 examples/coerce_intro.rb
myrrha-3.0.0.rc3 examples/coerce_intro.rb
myrrha-3.0.0.rc2 examples/coerce_intro.rb
myrrha-3.0.0.rc1 examples/coerce_intro.rb
myrrha-2.0.0 examples/coerce_intro.rb
myrrha-1.2.2 examples/coerce_intro.rb
myrrha-1.2.1 examples/coerce_intro.rb
myrrha-1.2.0 examples/coerce_intro.rb
myrrha-1.1.0 examples/coerce_intro.rb
myrrha-1.0.0 examples/coerce_intro.rb