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.



465
466
467
468
# File 'lib/lxl.rb', line 465

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

Instance Attribute Details

#argsObject

Returns the value of attribute args.



463
464
465
# File 'lib/lxl.rb', line 463

def args
  @args
end

#symbolObject

Returns the value of attribute symbol.



463
464
465
# File 'lib/lxl.rb', line 463

def symbol
  @symbol
end