Class: Dependabot::GitTagWithDetail

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/dependabot/git_tag_with_detail.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tag:, release_date: nil) ⇒ GitTagWithDetail

Returns a new instance of GitTagWithDetail.



22
23
24
25
# File 'lib/dependabot/git_tag_with_detail.rb', line 22

def initialize(tag:, release_date: nil)
  @tag = tag
  @release_date = release_date
end

Instance Attribute Details

#release_dateObject

Returns the value of attribute release_date.



14
15
16
# File 'lib/dependabot/git_tag_with_detail.rb', line 14

def release_date
  @release_date
end

#tagObject

Returns the value of attribute tag.



11
12
13
# File 'lib/dependabot/git_tag_with_detail.rb', line 11

def tag
  @tag
end

Instance Method Details

#==(other) ⇒ Object



28
29
30
31
32
33
34
35
# File 'lib/dependabot/git_tag_with_detail.rb', line 28

def ==(other)
  case other
  when GitTagWithDetail
    to_h == other.to_h
  else
    false
  end
end

#to_hObject



38
39
40
41
42
43
# File 'lib/dependabot/git_tag_with_detail.rb', line 38

def to_h
  {
    tag: tag,
    release_date: release_date
  }.compact
end