Class: FlowMonitor::Message
- Inherits:
-
Object
- Object
- FlowMonitor::Message
- Defined in:
- lib/libcfruby/flowmonitor.rb
Overview
Encapsulates a controller message.
Instance Attribute Summary collapse
-
#caller ⇒ Object
readonly
Returns the value of attribute caller.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#add_tag(tag, value = true) ⇒ Object
adds a tag to the message.
-
#initialize(type, message) ⇒ Message
constructor
Build a message.
-
#to_s ⇒ Object
helper function to print message as a string.
Constructor Details
#initialize(type, message) ⇒ Message
Build a message. type
‘s used by the library are ’exception’, ‘intention’
194 195 196 197 198 199 |
# File 'lib/libcfruby/flowmonitor.rb', line 194 def initialize(type, ) @type = type.to_s() @message = .to_s() @tags = Hash.new() @caller = Kernel.caller() end |
Instance Attribute Details
#caller ⇒ Object (readonly)
Returns the value of attribute caller.
190 191 192 |
# File 'lib/libcfruby/flowmonitor.rb', line 190 def caller @caller end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
190 191 192 |
# File 'lib/libcfruby/flowmonitor.rb', line 190 def @message end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
190 191 192 |
# File 'lib/libcfruby/flowmonitor.rb', line 190 def @tags end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
190 191 192 |
# File 'lib/libcfruby/flowmonitor.rb', line 190 def type @type end |
Instance Method Details
#add_tag(tag, value = true) ⇒ Object
adds a tag to the message
203 204 205 |
# File 'lib/libcfruby/flowmonitor.rb', line 203 def add_tag(tag, value=true) @tags[tag.to_s()] = value end |
#to_s ⇒ Object
helper function to print message as a string
209 210 211 |
# File 'lib/libcfruby/flowmonitor.rb', line 209 def to_s() return("#{type} - #{}") end |