Class: SIF::Infra::Common::Message
- Inherits:
-
Object
- Object
- SIF::Infra::Common::Message
- Defined in:
- lib/sif/infra/common/message.rb
Instance Method Summary collapse
- #content ⇒ Object
- #datatype ⇒ Object
- #event? ⇒ Boolean
- #event_object ⇒ Object
- #final_packet? ⇒ Boolean
- #inner_message ⇒ Object
- #msg_id ⇒ Object
- #request_msg_id ⇒ Object
- #response? ⇒ Boolean
- #response_objects ⇒ Object
- #source_id ⇒ Object
- #status_code ⇒ Object
- #timestamp ⇒ Object
- #type ⇒ Object
Instance Method Details
#content ⇒ Object
69 70 71 72 73 |
# File 'lib/sif/infra/common/message.rb', line 69 def content ack || event || provide || provision || register || request || response || subscribe || system_control || unprovide || unregister || unsubscribe end |
#datatype ⇒ Object
61 62 63 64 65 66 67 |
# File 'lib/sif/infra/common/message.rb', line 61 def datatype if response? && !response_objects.empty? .response.object_data.datatype elsif event? && event_object event_object.datatype end end |
#event? ⇒ Boolean
33 34 35 |
# File 'lib/sif/infra/common/message.rb', line 33 def event? && !.event.nil? end |
#event_object ⇒ Object
51 52 53 54 55 |
# File 'lib/sif/infra/common/message.rb', line 51 def event_object .event.object_data.event_object rescue NoMethodError nil end |
#final_packet? ⇒ Boolean
37 38 39 |
# File 'lib/sif/infra/common/message.rb', line 37 def final_packet? response? && !.response.more_packets? end |
#inner_message ⇒ Object
23 24 25 26 27 |
# File 'lib/sif/infra/common/message.rb', line 23 def ack.status.data. rescue NoMethodError nil end |
#msg_id ⇒ Object
79 80 81 |
# File 'lib/sif/infra/common/message.rb', line 79 def msg_id content && content.header.msg_id end |
#request_msg_id ⇒ Object
41 42 43 |
# File 'lib/sif/infra/common/message.rb', line 41 def request_msg_id response? && .response.request_msg_id end |
#response? ⇒ Boolean
29 30 31 |
# File 'lib/sif/infra/common/message.rb', line 29 def response? && !.response.nil? end |
#response_objects ⇒ Object
45 46 47 48 49 |
# File 'lib/sif/infra/common/message.rb', line 45 def response_objects .response.object_data.objects rescue NoMethodError nil end |
#source_id ⇒ Object
75 76 77 |
# File 'lib/sif/infra/common/message.rb', line 75 def source_id content && content.header.source_id end |
#status_code ⇒ Object
87 88 89 |
# File 'lib/sif/infra/common/message.rb', line 87 def status_code ack && ack.status.code end |
#timestamp ⇒ Object
83 84 85 |
# File 'lib/sif/infra/common/message.rb', line 83 def content && content.header. end |
#type ⇒ Object
57 58 59 |
# File 'lib/sif/infra/common/message.rb', line 57 def type if event then :event else :response end end |