Module: Pio::InstanceInspector

Included in:
Arp::Reply, Arp::Request, EthernetFrame, EthernetHeader, IPv4Header, Pio::Icmp::Message
Defined in:
lib/pio/instance_inspector.rb

Overview

Introduces #inspect method

Instance Method Summary collapse

Instance Method Details

#inspectObject



6
7
8
9
10
11
12
13
14
# File 'lib/pio/instance_inspector.rb', line 6

def inspect
  "#<#{self.class.name} " +
    field_names.map do |each|
      next if each == :padding
      next unless __send__("#{each}?")
      "#{each}: #{__send__(each).inspect}"
    end.compact.join(', ') +
    '>'
end