Class: LXL::Deferred

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

Overview

Snapshots the symbol/arguments of a function call for later use.

class MyNamespace < LXL::Namespace
  register_deferred :foo
end
LXL.new(MyNamespace.new).eval('=FOO(1, "two", 3)')
# => <LXL::Deferred @args=[1, "two", 3] @symbol=:foo>

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(symbol, *args) ⇒ Deferred

Returns a new instance of Deferred.



498
499
500
501
# File 'lib/lxl.rb', line 498

def initialize(symbol, *args)
  @symbol = symbol
  @args = args
end

Instance Attribute Details

#argsObject

Returns the value of attribute args.



496
497
498
# File 'lib/lxl.rb', line 496

def args
  @args
end

#symbolObject

Returns the value of attribute symbol.



496
497
498
# File 'lib/lxl.rb', line 496

def symbol
  @symbol
end