Exception: TimestampAPI::UnknownAssociation

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(klass, association_name) ⇒ UnknownAssociation

Returns a new instance of UnknownAssociation.



62
63
64
65
# File 'lib/timestamp_api/errors.rb', line 62

def initialize(klass, association_name)
  @klass            = klass
  @association_name = association_name
end

Instance Attribute Details

#association_nameObject (readonly)

Returns the value of attribute association_name.



60
61
62
# File 'lib/timestamp_api/errors.rb', line 60

def association_name
  @association_name
end

#klassObject (readonly)

Returns the value of attribute klass.



60
61
62
# File 'lib/timestamp_api/errors.rb', line 60

def klass
  @klass
end

Instance Method Details

#messageObject



67
68
69
# File 'lib/timestamp_api/errors.rb', line 67

def message
  "Association `#{association_name}` could not be found on model `#{klass}`."
end