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

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



66
67
68
69
70
71
72
73
74
75
# File 'foobara-0.1.7/projects/persistence/src/entity_attributes_crud_driver.rb', line 66

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.



52
53
54
# File 'foobara-0.1.7/projects/persistence/src/entity_attributes_crud_driver.rb', line 52

def record_id
  @record_id
end

Instance Method Details

#verbObject



54
55
56
57
58
59
60
61
62
63
64
# File 'foobara-0.1.7/projects/persistence/src/entity_attributes_crud_driver.rb', line 54

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