Class: Dependabot::Credential

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

Instance Method Summary collapse

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

Returns:

  • (Boolean)


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

def replaces_base?
  @replaces_base
end

#to_hObject



37
38
39
# File 'lib/dependabot/credential.rb', line 37

def to_h
  @credential
end