Exception: Foobara::Persistence::EntityAttributesCrudDriver::Table::CannotCrudError

Inherits:
StandardError
  • Object
show all
Defined in:
foobara-0.2.6/projects/persistence/src/entity_attributes_crud_driver.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(record_id, submessage = nil) ⇒ CannotCrudError

Returns a new instance of CannotCrudError.



89
90
91
92
93
94
95
96
97
98
# File 'projects/persistence/src/entity_attributes_crud_driver.rb', line 89

def initialize(record_id, submessage = nil)
  self.record_id = record_id
  message = "Could not #{verb} for id #{record_id.inspect}"

  if submessage
    message = "#{message}: #{submessage}"
  end

  super(message)
end

Instance Attribute Details

#record_idObject

Returns the value of attribute record_id.



75
76
77
# File 'projects/persistence/src/entity_attributes_crud_driver.rb', line 75

def record_id
  @record_id
end

Instance Method Details

#verbObject



77
78
79
80
81
82
83
84
85
86
87
# File 'projects/persistence/src/entity_attributes_crud_driver.rb', line 77

def verb
  match = /^Cannot(\w+)Error$/.match(Util.non_full_name(self.class))

  unless match
    # :nocov:
    raise "Bad error name for #{self.class.name}"
    # :nocov:
  end

  Util.underscore(match[1])
end