Class: JavaScript::BoundFunction

Inherits:
Function
  • Object
show all
Defined in:
lib/javascript.rb

Instance Attribute Summary

Attributes inherited from Function

#args, #body, #name

Instance Method Summary collapse

Methods inherited from Function

#arity, #to_proc

Constructor Details

#initialize(target, name, args, body) ⇒ BoundFunction

Returns a new instance of BoundFunction.



257
258
259
260
# File 'lib/javascript.rb', line 257

def initialize(target, name, args, body)
  super(name, args, body)
  @target = target
end

Instance Method Details

#apply(_, arg_values) ⇒ Object



266
267
268
# File 'lib/javascript.rb', line 266

def apply(_, arg_values)
  super(@target, arg_values)
end

#bind(_) ⇒ Object



270
271
272
# File 'lib/javascript.rb', line 270

def bind(_)
  self
end

#call(_, *arg_values) ⇒ Object



262
263
264
# File 'lib/javascript.rb', line 262

def call(_, *arg_values)
  super(@target, *arg_values)
end