Class: Mqlight::Malformed
- Inherits:
-
Object
- Object
- Mqlight::Malformed
- Includes:
- Logging
- Defined in:
- lib/mqlight/delivery.rb
Overview
Class to contained malformed information relating to a received message
Instance Attribute Summary collapse
-
#description ⇒ String
readonly
Contains a description of why the message is malformed.
-
#format ⇒ String
readonly
Contains a symbol of why the message is malformed.
-
#mqmd_CodeCharSetId ⇒ String
readonly
MQMD CodedCharSetId field.
-
#mqmd_condition ⇒ String
readonly
MQMD Format field.
Instance Method Summary collapse
- #as_hash ⇒ Object
-
#initialize(instructions) ⇒ Malformed
constructor
A new instance of Malformed.
- #to_s ⇒ Object
Methods included from Logging
Constructor Details
#initialize(instructions) ⇒ Malformed
Returns a new instance of Malformed.
141 142 143 144 145 146 147 148 149 150 151 152 153 |
# File 'lib/mqlight/delivery.rb', line 141 def initialize (instructions) logger.entry(@id) { self.class.to_s + '#' + __method__.to_s } parms = Hash[method(__method__).parameters.map do |parm| [parm[1], eval(parm[1].to_s)] end] logger.parms(@id, parms) { self.class.to_s + '#' + __method__.to_s } @format = instructions["x-opt-message-malformed-MQMD.Format"]; @description = instructions["x-opt-message-malformed-description"]; @coded_char_set_id = instructions["x-opt-message-malformed-MQMD.CodedCharSetId"]; @condition = instructions["x-opt-message-malformed-condition"]; logger.exit(@id) { self.class.to_s + '#' + __method__.to_s } end |
Instance Attribute Details
#description ⇒ String (readonly)
Returns contains a description of why the message is malformed.
135 136 137 |
# File 'lib/mqlight/delivery.rb', line 135 def description @description end |
#format ⇒ String (readonly)
Returns contains a symbol of why the message is malformed.
133 134 135 |
# File 'lib/mqlight/delivery.rb', line 133 def format @format end |
#mqmd_CodeCharSetId ⇒ String (readonly)
Returns MQMD CodedCharSetId field.
137 138 139 |
# File 'lib/mqlight/delivery.rb', line 137 def mqmd_CodeCharSetId @mqmd_CodeCharSetId end |
#mqmd_condition ⇒ String (readonly)
Returns MQMD Format field.
139 140 141 |
# File 'lib/mqlight/delivery.rb', line 139 def mqmd_condition @mqmd_condition end |
Instance Method Details
#as_hash ⇒ Object
155 156 157 158 159 160 161 162 163 164 165 |
# File 'lib/mqlight/delivery.rb', line 155 def as_hash mqmd_hash = { 'CodedCharSetId' => @coded_char_set_id, 'Format' => @format } malformed_hash = { 'condition' => @condition, 'description' => @description, 'MQMD' => mqmd_hash } end |
#to_s ⇒ Object
167 168 169 170 171 172 173 174 |
# File 'lib/mqlight/delivery.rb', line 167 def to_s info = '{' info << 'condition: ' + @condition.to_s unless @condition.nil? info << ', description: ' + @description.to_s unless @description.nil? info << ', CodedCharSetId: ' + @coded_char_set_id.to_s unless @coded_char_set_id.nil? info << ', Format: ' + @format.to_s unless @format.nil? info << '}' end |