Class: IsItWorking::Status::Message
- Inherits:
-
Object
- Object
- IsItWorking::Status::Message
- Defined in:
- lib/is_it_working/status.rb
Overview
This class is used to contain individual status messages. Eache method can represent either and ok
message or a fail
message.
Class Attribute Summary collapse
-
.ok_states ⇒ Object
Returns the value of attribute ok_states.
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Instance Method Summary collapse
-
#initialize(message, state) ⇒ Message
constructor
A new instance of Message.
- #ok? ⇒ Boolean
Constructor Details
#initialize(message, state) ⇒ Message
Returns a new instance of Message.
19 20 21 22 |
# File 'lib/is_it_working/status.rb', line 19 def initialize(, state) @message = @state = state end |
Class Attribute Details
.ok_states ⇒ Object
Returns the value of attribute ok_states.
10 11 12 |
# File 'lib/is_it_working/status.rb', line 10 def ok_states @ok_states end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
15 16 17 |
# File 'lib/is_it_working/status.rb', line 15 def @message end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
16 17 18 |
# File 'lib/is_it_working/status.rb', line 16 def state @state end |
Instance Method Details
#ok? ⇒ Boolean
24 25 26 |
# File 'lib/is_it_working/status.rb', line 24 def ok? self.class.ok_states.include? state end |