Exception: SmartProperties::MissingValueError

Inherits:
AssignmentError show all
Defined in:
lib/smart_properties/errors.rb

Instance Attribute Summary

Attributes inherited from AssignmentError

#property, #sender

Instance Method Summary collapse

Constructor Details

#initialize(sender, property) ⇒ MissingValueError

Returns a new instance of MissingValueError.



46
47
48
49
50
51
52
53
54
55
# File 'lib/smart_properties/errors.rb', line 46

def initialize(sender, property)
  super(
    sender,
    property,
    "%s requires the property %s to be set" % [
      sender.class.name,
      property.name
    ]
  )
end

Instance Method Details

#to_hashObject



57
58
59
# File 'lib/smart_properties/errors.rb', line 57

def to_hash
  Hash[property.name, "must be set"]
end