Class: Paradeiser::Interrupt
- Inherits:
-
Object
- Object
- Paradeiser::Interrupt
- Defined in:
- lib/paradeiser/models/interrupt.rb
Direct Known Subclasses
Constant Summary collapse
- KNOWN_TYPES =
[:internal, :external]
Instance Attribute Summary collapse
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type = nil) ⇒ Interrupt
constructor
A new instance of Interrupt.
Constructor Details
#initialize(type = nil) ⇒ Interrupt
Returns a new instance of Interrupt.
6 7 8 9 10 |
# File 'lib/paradeiser/models/interrupt.rb', line 6 def initialize(type = nil) @type = type || :internal raise InvalidTypeError.new(@type, KNOWN_TYPES) unless KNOWN_TYPES.include?(@type) @created_at = Time.now end |
Instance Attribute Details
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
4 5 6 |
# File 'lib/paradeiser/models/interrupt.rb', line 4 def created_at @created_at end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
4 5 6 |
# File 'lib/paradeiser/models/interrupt.rb', line 4 def type @type end |