Class: Mpp::Credential

Inherits:
Data
  • Object
show all
Defined in:
lib/mpp/credential.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(challenge:, payload:, source: nil) ⇒ Credential

Returns a new instance of Credential.



6
7
8
# File 'lib/mpp/credential.rb', line 6

def initialize(challenge:, payload:, source: nil)
  super
end

Instance Attribute Details

#challengeObject (readonly)

Returns the value of attribute challenge

Returns:

  • (Object)

    the current value of challenge



5
6
7
# File 'lib/mpp/credential.rb', line 5

def challenge
  @challenge
end

#payloadObject (readonly)

Returns the value of attribute payload

Returns:

  • (Object)

    the current value of payload



5
6
7
# File 'lib/mpp/credential.rb', line 5

def payload
  @payload
end

#sourceObject (readonly)

Returns the value of attribute source

Returns:

  • (Object)

    the current value of source



5
6
7
# File 'lib/mpp/credential.rb', line 5

def source
  @source
end

Class Method Details

.from_authorization(header) ⇒ Object

Parse a Credential from an Authorization header value.



11
12
13
# File 'lib/mpp/credential.rb', line 11

def self.from_authorization(header)
  Mpp::Parsing.parse_authorization(header)
end

Instance Method Details

#to_authorizationObject

Serialize to an Authorization header value.



16
17
18
# File 'lib/mpp/credential.rb', line 16

def to_authorization
  Mpp::Parsing.format_authorization(self)
end