Exception: Exceptions::Base
- Inherits:
-
StandardError
- Object
- StandardError
- Exceptions::Base
- Defined in:
- lib/exceptions/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#object ⇒ Object
Returns the value of attribute object.
-
#type ⇒ Object
Returns the value of attribute type.
Class Method Summary collapse
-
.build(object) ⇒ Exceptions::Base
standard error for Models.
Instance Method Summary collapse
-
#initialize(object) ⇒ Base
constructor
starts a new instance with an object.
-
#model? ⇒ Boolean
return if is as model error.
-
#simple? ⇒ Boolean
return if is as simple error.
Constructor Details
#initialize(object) ⇒ Base
starts a new instance with an object
6 7 8 |
# File 'lib/exceptions/base.rb', line 6 def initialize object self.object = object end |
Instance Attribute Details
#object ⇒ Object
Returns the value of attribute object.
2 3 4 |
# File 'lib/exceptions/base.rb', line 2 def object @object end |
#type ⇒ Object
Returns the value of attribute type.
2 3 4 |
# File 'lib/exceptions/base.rb', line 2 def type @type end |
Class Method Details
.build(object) ⇒ Exceptions::Base
standard error for Models
13 14 15 16 |
# File 'lib/exceptions/base.rb', line 13 def self.build object exception = new object return exception end |
Instance Method Details
#model? ⇒ Boolean
return if is as model error
26 27 28 |
# File 'lib/exceptions/base.rb', line 26 def model? self.class.name.demodulize.tableize.singularize == "model" end |
#simple? ⇒ Boolean
return if is as simple error
20 21 22 |
# File 'lib/exceptions/base.rb', line 20 def simple? self.class.name.demodulize.tableize.singularize == "simple" end |