Class: HastCI::Task
- Inherits:
-
Object
- Object
- HastCI::Task
- Defined in:
- lib/hastci/task.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize(id:, name:) ⇒ Task
constructor
A new instance of Task.
Constructor Details
#initialize(id:, name:) ⇒ Task
Returns a new instance of Task.
7 8 9 10 11 |
# File 'lib/hastci/task.rb', line 7 def initialize(id:, name:) @id = id @name = name freeze end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/hastci/task.rb', line 5 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/hastci/task.rb', line 5 def name @name end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
13 14 15 |
# File 'lib/hastci/task.rb', line 13 def ==(other) other.is_a?(Task) && other.id == id && other.name == name end |
#hash ⇒ Object
19 20 21 |
# File 'lib/hastci/task.rb', line 19 def hash [id, name].hash end |