Class: VCSToolkit::Objects::Label

Inherits:
Object
  • Object
show all
Defined in:
lib/vcs_toolkit/objects/label.rb

Instance Attribute Summary collapse

Attributes inherited from Object

#id, #object_type

Instance Method Summary collapse

Methods inherited from Object

#named?

Methods included from Serializable

#from_hash, #serialize_on

Methods included from Utils::HashableObject

included

Constructor Details

#initialize(id:, reference_id:, **context) ⇒ Label

Returns a new instance of Label.



8
9
10
11
12
13
14
15
# File 'lib/vcs_toolkit/objects/label.rb', line 8

def initialize(id:, reference_id:, **context)
  @reference_id = reference_id

  super id:          id,
        object_type: :label,
        named:       true,
        **context
end

Instance Attribute Details

#reference_idObject

Returns the value of attribute reference_id.



5
6
7
# File 'lib/vcs_toolkit/objects/label.rb', line 5

def reference_id
  @reference_id
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



17
18
19
# File 'lib/vcs_toolkit/objects/label.rb', line 17

def ==(other)
  id == other.id and reference_id == other.reference_id
end

#hashObject



23
24
25
# File 'lib/vcs_toolkit/objects/label.rb', line 23

def hash
  [id, reference_id].hash
end