Sha256: 56a1f3fdbb92e72856869c8ff82e046607d5f82b354fc489f90fa2778ded5ce9

Contents?: true

Size: 233 Bytes

Versions: 15

Compression:

Stored size: 233 Bytes

Contents

require "myrrha/to_ruby_literal"

class Foo
  attr_reader :arg
  def initialize(arg)
    @arg = arg
  end
  def to_ruby_literal
    "Foo.new(#{arg.inspect})"
  end
end

Myrrha.to_ruby_literal(Foo.new(:hello))
# => "Foo.new(:hello)" 

Version data entries

15 entries across 15 versions & 1 rubygems

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