Class: Xap::XapUnsupportedMessage

Inherits:
XapMessage show all
Defined in:
lib/xap/xap_msg.rb

Overview

A fallback class (or inheritable utility class) for messages not supported by a loaded schema.

Direct Known Subclasses

Schema::XapBscMessage

Instance Attribute Summary

Attributes inherited from XapMessage

#headername, #hop, #msgclass, #src_addr, #target_addr, #uid, #version

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from XapMessage

register_class, #to_s, #uid_endpoint

Constructor Details

#initialize(msgclass, src_addr, src_uid, target_addr = nil) ⇒ XapUnsupportedMessage

Returns a new instance of XapUnsupportedMessage.



158
159
160
161
162
163
164
165
166
167
168
169
# File 'lib/xap/xap_msg.rb', line 158

def initialize msgclass, src_addr, src_uid, target_addr = nil
	@headername ||= 'xap-header'
	if msgclass.is_a?(Hash)
		parse_header msgclass[@headername]

		blocks = msgclass.clone
		blocks.delete @headername
		set_blocks blocks
	else
		super msgclass, src_addr, src_uid, target_addr
	end
end

Class Method Details

.parse(hash) ⇒ Object



154
155
156
# File 'lib/xap/xap_msg.rb', line 154

def self.parse hash
	self.new hash, nil, nil
end