Class: RUBG::Status
- Inherits:
-
RubgEndpoint
- Object
- RubgEndpoint
- RUBG::Status
- Defined in:
- lib/rubg/status.rb
Instance Attribute Summary collapse
-
#alive ⇒ Object
readonly
Returns the value of attribute alive.
-
#released_at ⇒ Object
readonly
Returns the value of attribute released_at.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Attributes inherited from RubgEndpoint
#data, #errors, #ratelimit, #ratelimit_remaining, #ratelimit_reset, #raw_response, #response_ts
Class Method Summary collapse
Instance Method Summary collapse
- #alive? ⇒ Boolean
-
#initialize(args) ⇒ Status
constructor
A new instance of Status.
Methods inherited from RubgEndpoint
Constructor Details
#initialize(args) ⇒ Status
Returns a new instance of Status.
5 6 7 8 9 10 11 12 |
# File 'lib/rubg/status.rb', line 5 def initialize( args ) args = self.class.defaults.merge(args) @alive = ((args[:response].response.class == Net::HTTPOK) ? true : false) @released_at = Time.parse(args[:response]["data"]["attributes"]["releasedAt"]) @version = args[:response]["data"]["attributes"]["version"] super end |
Instance Attribute Details
#alive ⇒ Object (readonly)
Returns the value of attribute alive.
3 4 5 |
# File 'lib/rubg/status.rb', line 3 def alive @alive end |
#released_at ⇒ Object (readonly)
Returns the value of attribute released_at.
3 4 5 |
# File 'lib/rubg/status.rb', line 3 def released_at @released_at end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
3 4 5 |
# File 'lib/rubg/status.rb', line 3 def version @version end |
Class Method Details
Instance Method Details
#alive? ⇒ Boolean
28 29 30 |
# File 'lib/rubg/status.rb', line 28 def alive? @alive ? true : false end |