Class: Dependabot::Credential
- Inherits:
-
Object
- Object
- Dependabot::Credential
- Extended by:
- Forwardable, T::Sig
- Defined in:
- lib/dependabot/credential.rb
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(credential) ⇒ Credential
constructor
A new instance of Credential.
- #merge(other) ⇒ Object
- #replaces_base? ⇒ Boolean
- #to_h ⇒ Object
Constructor Details
#initialize(credential) ⇒ Credential
Returns a new instance of Credential.
15 16 17 18 19 |
# File 'lib/dependabot/credential.rb', line 15 def initialize(credential) @replaces_base = T.let(credential["replaces-base"] == true, T::Boolean) credential.delete("replaces-base") @credential = T.let(T.unsafe(credential), T::Hash[String, String]) end |
Instance Method Details
#[](key) ⇒ Object
27 28 29 |
# File 'lib/dependabot/credential.rb', line 27 def [](key) @credential[key] end |
#merge(other) ⇒ Object
32 33 34 |
# File 'lib/dependabot/credential.rb', line 32 def merge(other) Credential.new(@credential.merge(other.to_h)) end |
#replaces_base? ⇒ Boolean
22 23 24 |
# File 'lib/dependabot/credential.rb', line 22 def replaces_base? @replaces_base end |
#to_h ⇒ Object
37 38 39 |
# File 'lib/dependabot/credential.rb', line 37 def to_h @credential end |