Exception: Holotype::MissingRequiredAttributesError

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(original_class, attributes) ⇒ MissingRequiredAttributesError

Returns a new instance of MissingRequiredAttributesError.



5
6
7
8
# File 'lib/holotype/missing_required_attributes_error.rb', line 5

def initialize original_class, attributes
  @attributes     = attributes
  @original_class = original_class
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



3
4
5
# File 'lib/holotype/missing_required_attributes_error.rb', line 3

def attributes
  @attributes
end

#original_classObject (readonly)

Returns the value of attribute original_class.



3
4
5
# File 'lib/holotype/missing_required_attributes_error.rb', line 3

def original_class
  @original_class
end

Instance Method Details

#messageObject



10
11
12
13
14
15
16
# File 'lib/holotype/missing_required_attributes_error.rb', line 10

def message
  "Class `#{original_class.name}` requires the following attributes:" \
  "#{format_list required_attributes}"                                \
  "\n\n"                                                              \
  "Missing attributes:"                                               \
  "#{format_list attributes}".freeze
end