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

Inherits:
StandardError
  • Object
show all
Defined in:
foobara-0.0.110/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.



60
61
62
63
64
65
66
67
68
69
# File 'foobara-0.0.110/projects/persistence/src/entity_attributes_crud_driver.rb', line 60

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.



46
47
48
# File 'foobara-0.0.110/projects/persistence/src/entity_attributes_crud_driver.rb', line 46

def record_id
  @record_id
end

Instance Method Details

#verbObject



48
49
50
51
52
53
54
55
56
57
58
# File 'foobara-0.0.110/projects/persistence/src/entity_attributes_crud_driver.rb', line 48

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