Exception: AttributesReader::MissingAttributeError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/attributes_reader.rb

Instance Method Summary collapse

Constructor Details

#initialize(attr_name, class_name) ⇒ MissingAttributeError

Returns a new instance of MissingAttributeError.



21
22
23
24
25
# File 'lib/attributes_reader.rb', line 21

def initialize attr_name, class_name
  @attr = attr_name
  @class = class_name
  super(message)
end

Instance Method Details

#messageObject



27
28
29
# File 'lib/attributes_reader.rb', line 27

def message
  return "Missing Attribute #{@attr} for #{@class}"
end