Class: Dependabot::GitRef
- Inherits:
-
Object
- Object
- Dependabot::GitRef
- Extended by:
- T::Sig
- Defined in:
- lib/dependabot/git_ref.rb
Instance Attribute Summary collapse
-
#commit_sha ⇒ Object
Returns the value of attribute commit_sha.
-
#name ⇒ Object
Returns the value of attribute name.
-
#ref_sha ⇒ Object
readonly
Returns the value of attribute ref_sha.
-
#ref_type ⇒ Object
readonly
Returns the value of attribute ref_type.
-
#tag_sha ⇒ Object
readonly
Returns the value of attribute tag_sha.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(name:, commit_sha:, tag_sha: nil, ref_sha: nil, ref_type: nil) ⇒ GitRef
constructor
A new instance of GitRef.
- #to_h ⇒ Object
Constructor Details
#initialize(name:, commit_sha:, tag_sha: nil, ref_sha: nil, ref_type: nil) ⇒ GitRef
Returns a new instance of GitRef.
35 36 37 38 39 40 41 |
# File 'lib/dependabot/git_ref.rb', line 35 def initialize(name:, commit_sha:, tag_sha: nil, ref_sha: nil, ref_type: nil) @name = name @commit_sha = commit_sha @ref_sha = ref_sha @tag_sha = tag_sha @ref_type = ref_type end |
Instance Attribute Details
#commit_sha ⇒ Object
Returns the value of attribute commit_sha.
14 15 16 |
# File 'lib/dependabot/git_ref.rb', line 14 def commit_sha @commit_sha end |
#name ⇒ Object
Returns the value of attribute name.
11 12 13 |
# File 'lib/dependabot/git_ref.rb', line 11 def name @name end |
#ref_sha ⇒ Object (readonly)
Returns the value of attribute ref_sha.
20 21 22 |
# File 'lib/dependabot/git_ref.rb', line 20 def ref_sha @ref_sha end |
#ref_type ⇒ Object (readonly)
Returns the value of attribute ref_type.
23 24 25 |
# File 'lib/dependabot/git_ref.rb', line 23 def ref_type @ref_type end |
#tag_sha ⇒ Object (readonly)
Returns the value of attribute tag_sha.
17 18 19 |
# File 'lib/dependabot/git_ref.rb', line 17 def tag_sha @tag_sha end |
Instance Method Details
#==(other) ⇒ Object
44 45 46 47 48 49 50 51 |
# File 'lib/dependabot/git_ref.rb', line 44 def ==(other) case other when GitRef to_h == other.to_h else false end end |
#to_h ⇒ Object
54 55 56 57 58 59 60 61 62 |
# File 'lib/dependabot/git_ref.rb', line 54 def to_h { name: name, commit_sha: commit_sha, tag_sha: tag_sha, ref_sha: ref_sha, ref_type: ref_type }.compact end |