Class: GithubStatus::Status
- Inherits:
-
Object
- Object
- GithubStatus::Status
- Defined in:
- lib/github_status/status.rb
Constant Summary collapse
- GOOD =
"good"- MAJOR =
"major"- MINOR =
"minor"
Instance Attribute Summary collapse
-
#created_on ⇒ Object
readonly
Returns the value of attribute created_on.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Class Method Summary collapse
Instance Method Summary collapse
- #good? ⇒ Boolean
-
#initialize(options) ⇒ Status
constructor
A new instance of Status.
- #major? ⇒ Boolean
- #minor? ⇒ Boolean
Constructor Details
#initialize(options) ⇒ Status
Returns a new instance of Status.
10 11 12 13 14 |
# File 'lib/github_status/status.rb', line 10 def initialize() @status = [:status] = [:body] @created_on = DateTime.parse([:created_on]) end |
Instance Attribute Details
#created_on ⇒ Object (readonly)
Returns the value of attribute created_on.
8 9 10 |
# File 'lib/github_status/status.rb', line 8 def created_on @created_on end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
8 9 10 |
# File 'lib/github_status/status.rb', line 8 def end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
8 9 10 |
# File 'lib/github_status/status.rb', line 8 def status @status end |
Class Method Details
.current ⇒ Object
16 17 18 19 20 21 |
# File 'lib/github_status/status.rb', line 16 def self.current response = GithubStatus::API.current_status response[:created_on] = response[:last_updated] response[:body] = '' new(response) end |
.last_message ⇒ Object
23 24 25 |
# File 'lib/github_status/status.rb', line 23 def self. new(GithubStatus::API.) end |
.messages ⇒ Object
27 28 29 |
# File 'lib/github_status/status.rb', line 27 def self. GithubStatus::API..collect { |response| new(response) } end |
Instance Method Details
#good? ⇒ Boolean
31 32 33 |
# File 'lib/github_status/status.rb', line 31 def good? status == GOOD end |
#major? ⇒ Boolean
35 36 37 |
# File 'lib/github_status/status.rb', line 35 def major? status == MAJOR end |
#minor? ⇒ Boolean
39 40 41 |
# File 'lib/github_status/status.rb', line 39 def minor? status == MINOR end |