Class: ServerStatusApp::Status

Inherits:
Object
  • Object
show all
Defined in:
lib/server_status/app.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#codeObject (readonly)

Returns the value of attribute code.



36
37
38
# File 'lib/server_status/app.rb', line 36

def code
  @code
end

#descriptionObject (readonly)

Returns the value of attribute description.



36
37
38
# File 'lib/server_status/app.rb', line 36

def description
  @description
end

#nameObject (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

Returns:

  • (Boolean)


42
43
44
# File 'lib/server_status/app.rb', line 42

def is_open?
  @is_open
end

#to_jsonObject



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