Exception: CouchDB::InvalidValue

Inherits:
PropertyError show all
Defined in:
lib/couchdb/errors.rb

Instance Attribute Summary collapse

Attributes inherited from PropertyError

#name

Instance Method Summary collapse

Constructor Details

#initialize(name, value, reason = nil) ⇒ InvalidValue

Returns a new instance of InvalidValue.



43
44
45
46
# File 'lib/couchdb/errors.rb', line 43

def initialize(name, value, reason = nil)
  @value, @reason = value, reason
  super name, "#{value.inspect} is not a valid value for #{name} (#{reason})."
end

Instance Attribute Details

#reasonObject

Returns the value of attribute reason.



41
42
43
# File 'lib/couchdb/errors.rb', line 41

def reason
  @reason
end

#valueObject

Returns the value of attribute value.



41
42
43
# File 'lib/couchdb/errors.rb', line 41

def value
  @value
end

Instance Method Details

#to_hashObject



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

def to_hash
  {:property => name, :value => value, :error => 'invalid'}
end