Class: H8::ProcGate

Inherits:
Object show all
Defined in:
lib/h8/context.rb

Overview

The gate for Ruby’s callable to support javascript’s ‘apply’ functionality

Instance Method Summary collapse

Constructor Details

#initialize(callable) ⇒ ProcGate

Returns a new instance of ProcGate.



216
217
218
# File 'lib/h8/context.rb', line 216

def initialize callable
  @callable = callable
end

Instance Method Details

#apply(this, args) ⇒ Object



220
221
222
# File 'lib/h8/context.rb', line 220

def apply this, args
  @callable.call *args
end

#call(*args) ⇒ Object



224
225
226
# File 'lib/h8/context.rb', line 224

def call *args
  @callable.call *args
end