Module: Zm::Inspector

Included in:
Client::Base::ObjectsCollection, Client::ConcatMember, Client::LdapFilter
Defined in:
lib/zm/modules/inspector.rb

Instance Method Summary collapse

Instance Method Details

#inspectObject



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_mapObject



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_hObject



9
10
11
# File 'lib/zm/modules/inspector.rb', line 9

def to_h
  Hash[instance_variables_map]
end

#to_sObject



5
6
7
# File 'lib/zm/modules/inspector.rb', line 5

def to_s
  inspect
end