Class: Noticent::Definitions::Alert::DefaultValue

Inherits:
Object
  • Object
show all
Defined in:
lib/noticent/definitions/alert.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(alert, channel, value) ⇒ DefaultValue

Returns a new instance of DefaultValue.



122
123
124
125
126
# File 'lib/noticent/definitions/alert.rb', line 122

def initialize(alert, channel, value)
  @alert = alert
  @channel = channel
  @value = value
end

Instance Attribute Details

#channelObject (readonly)

Returns the value of attribute channel.



119
120
121
# File 'lib/noticent/definitions/alert.rb', line 119

def channel
  @channel
end

#valueObject

Returns the value of attribute value.



120
121
122
# File 'lib/noticent/definitions/alert.rb', line 120

def value
  @value
end

Instance Method Details

#on(channel) ⇒ Object

Raises:



128
129
130
131
132
133
134
# File 'lib/noticent/definitions/alert.rb', line 128

def on(channel)
  raise BadConfiguration, "no channel named '#{channel}'" if @alert.config.channels[channel].nil?

  @channel = channel

  self
end