Class: Woodhouse::Watchdog::Status
- Inherits:
-
Object
- Object
- Woodhouse::Watchdog::Status
- Defined in:
- lib/woodhouse/watchdog.rb
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
Instance Method Summary collapse
-
#initialize(name, message, time = Time.now) ⇒ Status
constructor
A new instance of Status.
- #to_h ⇒ Object
Constructor Details
#initialize(name, message, time = Time.now) ⇒ Status
Returns a new instance of Status.
105 106 107 108 109 110 111 |
# File 'lib/woodhouse/watchdog.rb', line 105 def initialize(name, , time = Time.now) @name = name.to_sym @message = .dup.freeze @time = time.dup.freeze freeze end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
103 104 105 |
# File 'lib/woodhouse/watchdog.rb', line 103 def @message end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
103 104 105 |
# File 'lib/woodhouse/watchdog.rb', line 103 def name @name end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
103 104 105 |
# File 'lib/woodhouse/watchdog.rb', line 103 def time @time end |
Instance Method Details
#to_h ⇒ Object
113 114 115 |
# File 'lib/woodhouse/watchdog.rb', line 113 def to_h { name: @name, message: @message, time: @time } end |