Exception: Tag::UnacceptableTagType

Inherits:
StandardError
  • Object
show all
Defined in:
app/models/tag.rb

Instance Method Summary collapse

Constructor Details

#initialize(msg, tag, taggable) ⇒ UnacceptableTagType

Returns a new instance of UnacceptableTagType.

Raises:

  • (ArgumentError)


32
33
34
35
36
37
38
39
# File 'app/models/tag.rb', line 32

def initialize(msg, tag, taggable)
  super(msg)

  raise ArgumentError, "Expected #{Tag.class}: #{tag.class}"  unless tag.is_a?(Tag)
  raise ArgumentError, "Expected #{Taggable.class}: #{tag.class}"  unless taggable.is_a?(Taggable)
  @tag = tag
  @taggable = taggable
end