Class: Puma::Acme::Order

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

Overview

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#authorizationsObject

Returns the value of attribute authorizations

Returns:

  • (Object)

    the current value of authorizations



128
129
130
# File 'lib/puma/acme/structs.rb', line 128

def authorizations
  @authorizations
end

#errorObject

Returns the value of attribute error

Returns:

  • (Object)

    the current value of error



128
129
130
# File 'lib/puma/acme/structs.rb', line 128

def error
  @error
end

#expiresObject

Returns the value of attribute expires

Returns:

  • (Object)

    the current value of expires



128
129
130
# File 'lib/puma/acme/structs.rb', line 128

def expires
  @expires
end

#identifiersObject

Returns the value of attribute identifiers

Returns:

  • (Object)

    the current value of identifiers



128
129
130
# File 'lib/puma/acme/structs.rb', line 128

def identifiers
  @identifiers
end

#not_afterObject

Returns the value of attribute not_after

Returns:

  • (Object)

    the current value of not_after



128
129
130
# File 'lib/puma/acme/structs.rb', line 128

def not_after
  @not_after
end

#not_beforeObject

Returns the value of attribute not_before

Returns:

  • (Object)

    the current value of not_before



128
129
130
# File 'lib/puma/acme/structs.rb', line 128

def not_before
  @not_before
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



128
129
130
# File 'lib/puma/acme/structs.rb', line 128

def status
  @status
end

#urlObject

Returns the value of attribute url

Returns:

  • (Object)

    the current value of url



128
129
130
# File 'lib/puma/acme/structs.rb', line 128

def url
  @url
end

Class Method Details

.from(acme_order) ⇒ Object



130
131
132
133
134
135
# File 'lib/puma/acme/structs.rb', line 130

def self.from(acme_order)
  identifiers = acme_order.identifiers.map { |i| Identifier.new(i) }
  authorizations = acme_order.authorizations.map { |a| Authz.from(a) }

  new(acme_order.to_h.slice(*members).merge(identifiers: identifiers, authorizations: authorizations))
end

Instance Method Details

#expired?(now: Time.now.utc) ⇒ Boolean

Returns:

  • (Boolean)


137
138
139
# File 'lib/puma/acme/structs.rb', line 137

def expired?(now: Time.now.utc)
  expires < now
end