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)


73
74
75
76
77
78
79
80
# File 'lib/dcmgr/models/tag.rb', line 73

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