module AmazingPrint::OpenStruct
Public Class Methods
included(base)
click to toggle source
# File lib/amazing_print/ext/ostruct.rb, line 10 def self.included(base) base.send :alias_method, :cast_without_ostruct, :cast base.send :alias_method, :cast, :cast_with_ostruct end
Public Instance Methods
awesome_open_struct_instance(object)
click to toggle source
# File lib/amazing_print/ext/ostruct.rb, line 23 def awesome_open_struct_instance(object) "#{object.class} #{awesome_hash(object.marshal_dump)}" end
cast_with_ostruct(object, type)
click to toggle source
# File lib/amazing_print/ext/ostruct.rb, line 15 def cast_with_ostruct(object, type) cast = cast_without_ostruct(object, type) if defined?(::OpenStruct) && object.is_a?(::OpenStruct) cast = :open_struct_instance end cast end