Module: AwesomePrint::Node

Defined in:
lib/biosphere/node.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



86
87
88
89
# File 'lib/biosphere/node.rb', line 86

def self.included(base)
    base.send :alias_method, :cast_without_node, :cast
    base.send :alias_method, :cast, :cast_with_node
end

Instance Method Details

#awesome_node_instance(object) ⇒ Object



99
100
101
# File 'lib/biosphere/node.rb', line 99

def awesome_node_instance(object)
    "#{object.class} #{awesome_hash(object.data)}"
end

#cast_with_node(object, type) ⇒ Object



91
92
93
94
95
96
97
# File 'lib/biosphere/node.rb', line 91

def cast_with_node(object, type)
    cast = cast_without_node(object, type)
    if (defined?(::Biosphere::Node)) && (object.is_a?(::Biosphere::Node))
        cast = :node_instance
    end
    cast
end