Module: Zm::Inspector
- Defined in:
- lib/zm/modules/inspector.rb
Instance Method Summary collapse
Instance Method Details
#inspect ⇒ Object
13 14 15 16 |
# File 'lib/zm/modules/inspector.rb', line 13 def inspect keys_str = to_h.map { |k, v| "#{k}: #{v}" }.join(', ') "#{self.class}:#{format('0x00%x', (object_id << 1))} #{keys_str}" end |
#instance_variables_map ⇒ Object
18 19 20 21 22 |
# File 'lib/zm/modules/inspector.rb', line 18 def instance_variables_map keys = instance_variables.dup keys.delete(:@parent) keys.map { |key| [key, instance_variable_get(key)] } end |
#to_h ⇒ Object
9 10 11 |
# File 'lib/zm/modules/inspector.rb', line 9 def to_h Hash[instance_variables_map] end |
#to_s ⇒ Object
5 6 7 |
# File 'lib/zm/modules/inspector.rb', line 5 def to_s inspect end |