Exception: ObjectifiedSessions::Errors::DuplicateFieldNameError

Inherits:
Base
  • Object
show all
Defined in:
lib/objectified_sessions/errors.rb

Overview

Raised when you try to define a field that has the same name as a previously-defined field.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(session_class, field_name) ⇒ DuplicateFieldNameError

Returns a new instance of DuplicateFieldNameError.



32
33
34
35
36
37
# File 'lib/objectified_sessions/errors.rb', line 32

def initialize(session_class, field_name)
  @session_class = session_class
  @field_name = field_name

  super("Class #{@session_class.name} already has one field named #{@field_name.inspect}; you can't define another.")
end

Instance Attribute Details

#field_nameObject (readonly)

Returns the value of attribute field_name.



30
31
32
# File 'lib/objectified_sessions/errors.rb', line 30

def field_name
  @field_name
end

#session_classObject (readonly)

Returns the value of attribute session_class.



30
31
32
# File 'lib/objectified_sessions/errors.rb', line 30

def session_class
  @session_class
end