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



135
136
137
# File 'lib/puma/acme/structs.rb', line 135

def authorizations
  @authorizations
end

#errorObject

Returns the value of attribute error

Returns:

  • (Object)

    the current value of error



135
136
137
# File 'lib/puma/acme/structs.rb', line 135

def error
  @error
end

#expiresObject

Returns the value of attribute expires

Returns:

  • (Object)

    the current value of expires



135
136
137
# File 'lib/puma/acme/structs.rb', line 135

def expires
  @expires
end

#identifiersObject

Returns the value of attribute identifiers

Returns:

  • (Object)

    the current value of identifiers



135
136
137
# File 'lib/puma/acme/structs.rb', line 135

def identifiers
  @identifiers
end

#not_afterObject

Returns the value of attribute not_after

Returns:

  • (Object)

    the current value of not_after



135
136
137
# File 'lib/puma/acme/structs.rb', line 135

def not_after
  @not_after
end

#not_beforeObject

Returns the value of attribute not_before

Returns:

  • (Object)

    the current value of not_before



135
136
137
# File 'lib/puma/acme/structs.rb', line 135

def not_before
  @not_before
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



135
136
137
# File 'lib/puma/acme/structs.rb', line 135

def status
  @status
end

#urlObject

Returns the value of attribute url

Returns:

  • (Object)

    the current value of url



135
136
137
# File 'lib/puma/acme/structs.rb', line 135

def url
  @url
end

Class Method Details

.from(acme_order) ⇒ Object



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

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)


144
145
146
# File 'lib/puma/acme/structs.rb', line 144

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