Module: Lox::Callable

Included in:
Interpreter::NativeFunction, Function
Defined in:
lib/loxby/helpers/callable.rb

Overview

The interface for callable objects in loxby. Currently just functions.

To mark a class as callable, simply ‘include Lox::Callable`.

Instance Method Summary collapse

Instance Method Details

#arityObject

Raises:

  • (NotImplementedError)


14
15
16
# File 'lib/loxby/helpers/callable.rb', line 14

def arity
  raise NotImplementedError, "#{self.class} has not implemented #arity"
end

#call(_interpreter, _arguments) ⇒ Object

Raises:

  • (NotImplementedError)


10
11
12
# File 'lib/loxby/helpers/callable.rb', line 10

def call(_interpreter, _arguments)
  raise NotImplementedError, "#{self.class} has not implemented #call"
end