Exception: Embedson::ClassTypeError

Inherits:
TypeError
  • Object
show all
Defined in:
lib/embedson/exceptions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(wrong_name, correct_name) ⇒ ClassTypeError

Returns a new instance of ClassTypeError.



5
6
7
8
# File 'lib/embedson/exceptions.rb', line 5

def initialize(wrong_name, correct_name)
  @wrong_name, @correct_name = wrong_name, correct_name
  super(build_message)
end

Instance Attribute Details

#correct_nameObject (readonly)

Returns the value of attribute correct_name.



3
4
5
# File 'lib/embedson/exceptions.rb', line 3

def correct_name
  @correct_name
end

#wrong_nameObject (readonly)

Returns the value of attribute wrong_name.



3
4
5
# File 'lib/embedson/exceptions.rb', line 3

def wrong_name
  @wrong_name
end

Instance Method Details

#build_messageObject



10
11
12
# File 'lib/embedson/exceptions.rb', line 10

def build_message
  "wrong argument type #{wrong_name} (expected #{correct_name})"
end