Class: Lhj::ErbFormatter::Context

Inherits:
Object
  • Object
show all
Defined in:
lib/lhj/command/yapi/formatters/command_context.rb

Overview

context

Instance Method Summary collapse

Constructor Details

#initialize(target) ⇒ Context

Returns a new instance of Context.



7
8
9
# File 'lib/lhj/command/yapi/formatters/command_context.rb', line 7

def initialize(target)
  @target = target
end

Instance Method Details

#decorate_binding(bind) ⇒ Object

空方法



18
19
20
# File 'lib/lhj/command/yapi/formatters/command_context.rb', line 18

def decorate_binding(bind)
  bind.eval('save = 1')
end

#fetch_bindingObject



11
12
13
14
15
# File 'lib/lhj/command/yapi/formatters/command_context.rb', line 11

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