Class: Prowler::Success

Inherits:
Object
  • Object
show all
Defined in:
lib/prowler/response.rb

Direct Known Subclasses

ApiKey, Token

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(document) ⇒ Success

:nodoc:



27
28
29
30
31
32
33
# File 'lib/prowler/response.rb', line 27

def initialize(document) #:nodoc:
  success = document.elements["prowl/success"]

  @status = success.attributes["code"].to_i
  @remaining = success.attributes["remaining"].to_i
  @reset_date = Time.at(success.attributes["resetdate"].to_i)
end

Instance Attribute Details

#remainingObject (readonly)

The number of remaining requests until the counter is reset



22
23
24
# File 'lib/prowler/response.rb', line 22

def remaining
  @remaining
end

#reset_dateObject (readonly)

The time when the request counter will be reset



25
26
27
# File 'lib/prowler/response.rb', line 25

def reset_date
  @reset_date
end

#statusObject (readonly)

The status code returned by the Prowl API - always 200



19
20
21
# File 'lib/prowler/response.rb', line 19

def status
  @status
end