Class: Pione::System::Status
- Inherits:
-
Object
- Object
- Pione::System::Status
- Defined in:
- lib/pione/system/status.rb
Class Method Summary collapse
Instance Method Summary collapse
- #error? ⇒ Boolean
- #exception ⇒ Object
-
#initialize(status, property = {}) ⇒ Status
constructor
A new instance of Status.
- #message ⇒ Object
- #success? ⇒ Boolean
Constructor Details
#initialize(status, property = {}) ⇒ Status
Returns a new instance of Status.
14 15 16 17 |
# File 'lib/pione/system/status.rb', line 14 def initialize(status, property={}) @status = status @property = property end |
Class Method Details
.error(property = {}) ⇒ Object
9 10 11 |
# File 'lib/pione/system/status.rb', line 9 def error(property={}) new(:error, property) end |
.success ⇒ Object
5 6 7 |
# File 'lib/pione/system/status.rb', line 5 def success new(:success) end |
Instance Method Details
#error? ⇒ Boolean
23 24 25 |
# File 'lib/pione/system/status.rb', line 23 def error? @status == :error end |
#exception ⇒ Object
31 32 33 |
# File 'lib/pione/system/status.rb', line 31 def exception @property[:exception] end |
#message ⇒ Object
27 28 29 |
# File 'lib/pione/system/status.rb', line 27 def @property[:message] end |
#success? ⇒ Boolean
19 20 21 |
# File 'lib/pione/system/status.rb', line 19 def success? @status == :success end |