Class: ServerStatusApp::Status
- Inherits:
-
Object
- Object
- ServerStatusApp::Status
- Defined in:
- lib/server_status/app.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, description, code, is_open) ⇒ Status
constructor
A new instance of Status.
- #is_open? ⇒ Boolean
- #to_json ⇒ Object
Constructor Details
#initialize(name, description, code, is_open) ⇒ Status
Returns a new instance of Status.
38 39 40 |
# File 'lib/server_status/app.rb', line 38 def initialize name, description, code, is_open @code, @name, @description, @is_open = code.to_i, name, description, is_open end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
36 37 38 |
# File 'lib/server_status/app.rb', line 36 def code @code end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
36 37 38 |
# File 'lib/server_status/app.rb', line 36 def description @description end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
36 37 38 |
# File 'lib/server_status/app.rb', line 36 def name @name end |
Instance Method Details
#is_open? ⇒ Boolean
42 43 44 |
# File 'lib/server_status/app.rb', line 42 def is_open? @is_open end |
#to_json ⇒ Object
46 47 48 |
# File 'lib/server_status/app.rb', line 46 def to_json {name: @name, code: @code, description: @description, is_open: @is_open}.to_json end |