Class: Momo::FuncCall
- Inherits:
-
Object
- Object
- Momo::FuncCall
- Defined in:
- lib/momo/funccall.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(name, stack, *args) ⇒ FuncCall
constructor
A new instance of FuncCall.
- #representation ⇒ Object
Constructor Details
#initialize(name, stack, *args) ⇒ FuncCall
Returns a new instance of FuncCall.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/momo/funccall.rb', line 4 def initialize(name, stack, *args) @name = name @args = [] @stack = stack if !stack.is_a? Stack raise "#{stack.inspect} is not a stack" end args.each do |arg| @args << Momo.resolve(arg, stack: stack) end if @args.length == 1 @args = @args[0] end end |
Instance Method Details
#representation ⇒ Object
19 20 21 |
# File 'lib/momo/funccall.rb', line 19 def representation {@name => @args} end |