Module: RDKit::Introspection::ClassMethods

Included in:
RDKit::Introspection
Defined in:
lib/rdkit/introspection.rb

Instance Method Summary collapse

Instance Method Details

#info(section) ⇒ Object



164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# File 'lib/rdkit/introspection.rb', line 164

def info(section)
  default = @@server.introspection.merge({ stats: Stats.info })

  case section.downcase
  when 'default'
    default
  when 'all'
    default.merge({ commandstats: Commandstats.info, gc: GC.stat, objspace: ObjectSpace.count_objects, allobjects: all_objects })
  when 'commandstats'
    { commandstats: Commandstats.info }
  when 'gc'
    { gc: GC.stat }
  when 'objspace'
    { objspace: ObjectSpace.count_objects, allobjects: all_objects }
  else
    default.keep_if { |k, v| k == section.downcase.to_sym }
  end
end

#register(server) ⇒ Object



160
161
162
# File 'lib/rdkit/introspection.rb', line 160

def register(server)
  @@server = server
end