class WebConsole::Context
A context lets you get object names related to the current session binding.
def eval(cmd)
def eval(cmd) @binding.eval(cmd) rescue [] end
def extract(input = nil)
Otherwise, it extracts methods and constants of the object specified by
the inputs is present.
Extracts entire objects which can be called by the current session unless
def extract(input = nil) input.present? ? local(input) : global end
def global
def global GLOBAL_OBJECTS.map { |cmd| eval(cmd) } end
def initialize(binding)
def initialize(binding) @binding = binding end
def local(input)
def local(input) [ eval("#{input}.methods").map { |m| "#{input}.#{m}" }, eval("#{input}.constants").map { |c| "#{input}::#{c}" }, ] end