module AwesomePrint::IPAddress
Public Class Methods
included(base)
click to toggle source
# File lib/biosphere/node.rb, line 108 def self.included(base) base.send :alias_method, :cast_without_ipaddress, :cast base.send :alias_method, :cast, :cast_with_ipaddress end
Public Instance Methods
awesome_ipaddress_instance(object)
click to toggle source
# File lib/biosphere/node.rb, line 121 def awesome_ipaddress_instance(object) "#{object.class}(#{object.to_string})" end
cast_with_ipaddress(object, type)
click to toggle source
# File lib/biosphere/node.rb, line 113 def cast_with_ipaddress(object, type) cast = cast_without_ipaddress(object, type) if (defined?(::IPAddress)) && (object.is_a?(::IPAddress)) cast = :ipaddress_instance end cast end