Class: Acme::Resources::Challenges::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/acme/resources/challenges/base.rb

Direct Known Subclasses

DNS01, HTTP01

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client, attributes) ⇒ Base

Returns a new instance of Base.



5
6
7
8
# File 'lib/acme/resources/challenges/base.rb', line 5

def initialize(client, attributes)
  @client = client
  assign_attributes(attributes)
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



3
4
5
# File 'lib/acme/resources/challenges/base.rb', line 3

def client
  @client
end

#errorObject (readonly)

Returns the value of attribute error.



3
4
5
# File 'lib/acme/resources/challenges/base.rb', line 3

def error
  @error
end

#statusObject (readonly)

Returns the value of attribute status.



3
4
5
# File 'lib/acme/resources/challenges/base.rb', line 3

def status
  @status
end

#tokenObject (readonly)

Returns the value of attribute token.



3
4
5
# File 'lib/acme/resources/challenges/base.rb', line 3

def token
  @token
end

#uriObject (readonly)

Returns the value of attribute uri.



3
4
5
# File 'lib/acme/resources/challenges/base.rb', line 3

def uri
  @uri
end

Instance Method Details

#verify_statusObject



10
11
12
13
14
15
16
# File 'lib/acme/resources/challenges/base.rb', line 10

def verify_status
  response = @client.connection.get(@uri)

  assign_attributes(response.body)
  @error = response.body['error']
  status
end