Class: Hokusai::Mounting::LoopContext

Inherits:
Object
  • Object
show all
Defined in:
ui/src/hokusai/mounting/loop_entry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeLoopContext

Returns a new instance of LoopContext.



8
9
10
# File 'ui/src/hokusai/mounting/loop_entry.rb', line 8

def initialize
  @table = {}
end

Instance Attribute Details

#tableObject (readonly)

Returns the value of attribute table.



7
8
9
# File 'ui/src/hokusai/mounting/loop_entry.rb', line 7

def table
  @table
end

Instance Method Details

#add_entry(var, value) ⇒ Object



12
13
14
# File 'ui/src/hokusai/mounting/loop_entry.rb', line 12

def add_entry(var, value)
  table[var] = value
end

#send_target(target, func) ⇒ Object



16
17
18
19
20
21
22
# File 'ui/src/hokusai/mounting/loop_entry.rb', line 16

def send_target(target, func)
  args = func.args.map do |arg|
    table[arg]
  end

  target.public_send(func.method, *args)
end