Module: Commander::Patches::HelpFormatterBinding

Included in:
HelpFormatter::Context
Defined in:
lib/commander/patches/help_formatter_binding.rb

Instance Method Summary collapse

Instance Method Details

#get_binding(additional = {}) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/commander/patches/help_formatter_binding.rb', line 4

def get_binding(additional = {})
  bnd = @target.instance_eval { binding }.tap do |bind|
    decorate_binding(bind)
  end
  additional.each do |k, v|
    bnd.local_variable_set(k, v)
  end
  bnd
end