Sha256: 3f4e10610f3de28b965ae2f6bd4b6abb22fd71541f7aa8915c0ed2b86af82f25
Contents?: true
Size: 246 Bytes
Versions: 15
Compression:
Stored size: 246 Bytes
Contents
require 'myrrha/coerce' class Foo def initialize(arg) @arg = arg end end Myrrha::Coerce.append do |r| r.coercion(Symbol, Foo) do |value, _| Foo.new(value) end end Myrrha.coerce(:hello, Foo) # => #<Foo:0x8866f84 @arg=:hello>
Version data entries
15 entries across 15 versions & 1 rubygems