Exception: Pione::Lang::MethodNotFound

Inherits:
StandardError
  • Object
show all
Defined in:
lib/pione/lang/lang-exception.rb

Overview

MethodNotFound is an exception class for the case of method missing.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(env, name, receiver, arguments) ⇒ MethodNotFound

Creates an exception.

Parameters:

  • env (Environment)

    language environment

  • name (String)

    method name

  • receiver (Callable)

    method reciever

  • arguments (Array<Callable>)

    method arguments



191
192
193
194
195
196
# File 'lib/pione/lang/lang-exception.rb', line 191

def initialize(env, name, receiver, arguments)
  @env = env
  @name = name
  @receiver = receiver
  @arguments = arguments
end

Instance Attribute Details

#argumentsObject (readonly)

Returns the value of attribute arguments.



180
181
182
# File 'lib/pione/lang/lang-exception.rb', line 180

def arguments
  @arguments
end

#nameObject (readonly)

Returns the value of attribute name.



178
179
180
# File 'lib/pione/lang/lang-exception.rb', line 178

def name
  @name
end

#receiverObject (readonly)

Returns the value of attribute receiver.



179
180
181
# File 'lib/pione/lang/lang-exception.rb', line 179

def receiver
  @receiver
end

Instance Method Details

#messageObject



198
199
200
201
202
# File 'lib/pione/lang/lang-exception.rb', line 198

def message
  rec_type = @receiver.pione_type(@env)
  arg_types = @arguments.map{|arg| arg.pione_type(@env)}.join(" -> ")
  "PIONE method \"%s\" is not found: %s. %s" % [@name, rec_type, arg_types]
end