Class: Commander::HelpFormatter::Context

Inherits:
Object
  • Object
show all
Defined in:
lib/commander/help_formatters.rb

Direct Known Subclasses

ProgramContext

Instance Method Summary collapse

Constructor Details

#initialize(target) ⇒ Context

Returns a new instance of Context.



8
9
10
# File 'lib/commander/help_formatters.rb', line 8

def initialize(target)
  @target = target
end

Instance Method Details

#decorate_binding(_bind) ⇒ Object

No-op, override in subclasses.



19
20
# File 'lib/commander/help_formatters.rb', line 19

def decorate_binding(_bind)
end

#get_bindingObject



12
13
14
15
16
# File 'lib/commander/help_formatters.rb', line 12

def get_binding
  @target.instance_eval { binding }.tap do |bind|
    decorate_binding(bind)
  end
end