Class: Noticent::Definitions::Alert::DefaultValue
- Inherits:
-
Object
- Object
- Noticent::Definitions::Alert::DefaultValue
- Defined in:
- lib/noticent/definitions/alert.rb
Instance Attribute Summary collapse
-
#channel ⇒ Object
readonly
Returns the value of attribute channel.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(alert, channel, value) ⇒ DefaultValue
constructor
A new instance of DefaultValue.
- #on(channel) ⇒ Object
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
#channel ⇒ Object (readonly)
Returns the value of attribute channel.
119 120 121 |
# File 'lib/noticent/definitions/alert.rb', line 119 def channel @channel end |
#value ⇒ Object
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
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 |