Class: GraphAgent::Interrupt
- Inherits:
-
Object
- Object
- GraphAgent::Interrupt
- Defined in:
- lib/graph_agent/types/interrupt.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize(value, id: nil) ⇒ Interrupt
constructor
A new instance of Interrupt.
- #to_s ⇒ Object (also: #inspect)
Constructor Details
#initialize(value, id: nil) ⇒ Interrupt
Returns a new instance of Interrupt.
9 10 11 12 |
# File 'lib/graph_agent/types/interrupt.rb', line 9 def initialize(value, id: nil) @value = value @id = id || SecureRandom.hex(16) end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/graph_agent/types/interrupt.rb', line 7 def id @id end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
7 8 9 |
# File 'lib/graph_agent/types/interrupt.rb', line 7 def value @value end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
14 15 16 |
# File 'lib/graph_agent/types/interrupt.rb', line 14 def ==(other) other.is_a?(Interrupt) && id == other.id && value == other.value end |
#hash ⇒ Object
19 20 21 |
# File 'lib/graph_agent/types/interrupt.rb', line 19 def hash [id, value].hash end |
#to_s ⇒ Object Also known as: inspect
23 24 25 |
# File 'lib/graph_agent/types/interrupt.rb', line 23 def to_s "Interrupt(value=#{value.inspect}, id=#{id.inspect})" end |