Exception: CMDB::BadValue

Inherits:
Error
  • Object
show all
Defined in:
lib/cmdb.rb

Overview

A value of an unsupported type was encountered in the CMDB or filesystem.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uri, key, value, desc = nil) ⇒ BadValue

Returns a new instance of BadValue.

Parameters:

  • source (URI)

    that contains the bad value

  • key (String)

    CMDB key name under which the bad value was found

  • value (Object)

    the bad value itself



53
54
55
56
57
58
59
# File 'lib/cmdb.rb', line 53

def initialize(uri, key, value, desc=nil)
  @uri = uri
  @key = key
  msg = "Unsupported #{value.class.name} value"
  msg << ": #{desc}" if desc
  super(msg)
end

Instance Attribute Details

#keyString (readonly)

Returns the name of the key that contained the bad value.

Returns:

  • (String)

    the name of the key that contained the bad value



48
49
50
# File 'lib/cmdb.rb', line 48

def key
  @key
end

#uriURI (readonly)

Returns source that contains the bad data.

Returns:

  • (URI)

    source that contains the bad data



45
46
47
# File 'lib/cmdb.rb', line 45

def uri
  @uri
end