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.



288
289
290
# File 'lib/h8/context.rb', line 288

def initialize callable
  @callable = callable
end

Instance Method Details

#apply(this, args) ⇒ Object



292
293
294
# File 'lib/h8/context.rb', line 292

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

#call(*args) ⇒ Object



296
297
298
# File 'lib/h8/context.rb', line 296

def call *args
  @callable.call *args
end