Exception: Atomy::MessageMismatch

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/atomy/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, receiver, arguments = []) ⇒ MessageMismatch

Returns a new instance of MessageMismatch.



44
45
46
47
48
# File 'lib/atomy/errors.rb', line 44

def initialize(name, receiver, arguments = [])
  @name = name
  @receiver = receiver
  @arguments = arguments
end

Instance Attribute Details

#argumentsObject (readonly)

Returns the value of attribute arguments.



42
43
44
# File 'lib/atomy/errors.rb', line 42

def arguments
  @arguments
end

#nameObject (readonly)

Returns the value of attribute name.



42
43
44
# File 'lib/atomy/errors.rb', line 42

def name
  @name
end

#receiverObject (readonly)

Returns the value of attribute receiver.



42
43
44
# File 'lib/atomy/errors.rb', line 42

def receiver
  @receiver
end

Instance Method Details

#to_sObject



50
51
52
# File 'lib/atomy/errors.rb', line 50

def to_s
  "message `#{@name}(#{@arguments.collect(&:inspect).join(", ")})' was not understood by #{@receiver.inspect} (#{@receiver.class})"
end