Class: ServiceStatusResponse
- Inherits:
-
Object
- Object
- ServiceStatusResponse
- Defined in:
- lib/src/ServiceStatusResponse.rb
Direct Known Subclasses
NoServiceStatusResponse, ServiceErrorResponse, ServiceOkayResponse
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(message, state) ⇒ ServiceStatusResponse
constructor
A new instance of ServiceStatusResponse.
Constructor Details
#initialize(message, state) ⇒ ServiceStatusResponse
Returns a new instance of ServiceStatusResponse.
7 8 9 10 |
# File 'lib/src/ServiceStatusResponse.rb', line 7 def initialize(, state) @message = @state = state end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
5 6 7 |
# File 'lib/src/ServiceStatusResponse.rb', line 5 def @message end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
5 6 7 |
# File 'lib/src/ServiceStatusResponse.rb', line 5 def state @state end |
Class Method Details
.create(feedHtml) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/src/ServiceStatusResponse.rb', line 12 def self.create(feedHtml) return NoServiceStatusResponse.new if feedHtml.nil? rssFeed = SimpleRSS.parse(feedHtml) if OperatingNormallySpecification.is_satisified_by? rssFeed.items ServiceOkayResponse.new else ServiceErrorResponse.new(rssFeed.items.first[:title]) end end |