Class: Woodhouse::Watchdog::Status

Inherits:
Object
  • Object
show all
Defined in:
lib/woodhouse/watchdog.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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, message, time = Time.now)
  @name    = name.to_sym
  @message = message.dup.freeze
  @time    = time.dup.freeze

  freeze
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



103
104
105
# File 'lib/woodhouse/watchdog.rb', line 103

def message
  @message
end

#nameObject (readonly)

Returns the value of attribute name.



103
104
105
# File 'lib/woodhouse/watchdog.rb', line 103

def name
  @name
end

#timeObject (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_hObject



113
114
115
# File 'lib/woodhouse/watchdog.rb', line 113

def to_h
  { name: @name, message: @message, time: @time }
end