Class: Puma::Acme::Answer

Inherits:
Struct
  • Object
show all
Defined in:
lib/puma/acme/structs.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#tokenObject

Returns the value of attribute token

Returns:

  • (Object)

    the current value of token



21
22
23
# File 'lib/puma/acme/structs.rb', line 21

def token
  @token
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



21
22
23
# File 'lib/puma/acme/structs.rb', line 21

def type
  @type
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



21
22
23
# File 'lib/puma/acme/structs.rb', line 21

def value
  @value
end

Class Method Details

.from(acme_challenge) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/puma/acme/structs.rb', line 22

def self.from(acme_challenge)
  new(
    type: acme_challenge.challenge_type,
    token: acme_challenge.token,
    value: acme_challenge.key_authorization
  )
end

.key(type:, token:) ⇒ Object



30
31
32
# File 'lib/puma/acme/structs.rb', line 30

def self.key(type:, token:)
  new(type: type, token: token).key
end

Instance Method Details

#keyObject



34
35
36
# File 'lib/puma/acme/structs.rb', line 34

def key
  [:answer, type, token]
end