Class: Paradeiser::Interrupt

Inherits:
Object
  • Object
show all
Defined in:
lib/paradeiser/models/interrupt.rb

Direct Known Subclasses

ExternalInterrupt

Constant Summary collapse

KNOWN_TYPES =
[:internal, :external]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type = nil) ⇒ Interrupt

Returns a new instance of Interrupt.

Raises:



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_atObject (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

#typeObject (readonly)

Returns the value of attribute type.



4
5
6
# File 'lib/paradeiser/models/interrupt.rb', line 4

def type
  @type
end