Exception: Dcmgr::Models::Tag::UnacceptableTagType

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

Instance Method Summary collapse

Constructor Details

#initialize(msg, tag, taggable) ⇒ UnacceptableTagType

Returns a new instance of UnacceptableTagType.

Raises:

  • (ArgumentError)


64
65
66
67
68
69
70
71
# File 'lib/dcmgr/models/tag.rb', line 64

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

  raise ArgumentError, "Expected child of #{Tag} but #{tag.class}"  unless tag.is_a?(Tag)
  raise ArgumentError, "Expected kind of #{Taggable} but #{taggable.class}"  unless taggable.kind_of?(Taggable)
  @tag = tag
  @taggable = taggable
end