Class: Dtn::Messages::News::Base
- Inherits:
-
MessageWithSimpleParser
- Object
- OpenStruct
- Dtn::Message
- MessageWithSimpleParser
- Dtn::Messages::News::Base
- Defined in:
- lib/dtn/messages/news/base.rb
Overview
Base
Direct Known Subclasses
Class Method Summary collapse
Methods inherited from MessageWithSimpleParser
Methods inherited from Dtn::Message
#callback_name, callback_name, parse
Class Method Details
.fields ⇒ Object
9 10 11 |
# File 'lib/dtn/messages/news/base.rb', line 9 def fields @fields ||= { request_id: :to_i } end |
.parse_dynamic_fields(instance:, values:, request:) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/dtn/messages/news/base.rb', line 13 def parse_dynamic_fields(instance:, values:, request:) attributes = case request.[:format_type] when "t" then text_fields when "x" then xml_fields else raise "Wrong format type" end apply_values instance: instance, attributes: attributes, values: values end |