Class: Dtn::Lookups::News::Config

Inherits:
Base show all
Defined in:
lib/dtn/lookups/news/config.rb

Overview

News config

Constant Summary collapse

TEMPLATE =
"NCG,%<format_type>s,%<id>d"

Constants inherited from Base

Base::DEFAULT_NEWS_FORMAT_TYPE

Constants included from Concerns::Validation

Concerns::Validation::DATE_FORMAT, Concerns::Validation::DATE_TIME_FORMAT, Concerns::Validation::DEFAULT_INTERVAL_TYPE, Concerns::Validation::MAX_INT16

Constants inherited from Request

Request::END_OF_MESSAGE_CHARACTERS, Request::NO_DATA_CHARACTERS, Request::PORT, Request::SYNTAX_ERROR_CHARACTERS

Instance Attribute Summary

Attributes inherited from Request

#combined_options

Instance Method Summary collapse

Methods inherited from Request

call

Methods included from Concerns::Id

#id

Instance Method Details

#call(format_type: DEFAULT_NEWS_FORMAT_TYPE) ⇒ Object

Returns the News configuration which tells you what news sources you are subscribed to.

Example messages

NCG,[XML/Text],[RequestID]<CR><LF>


16
17
18
19
20
21
# File 'lib/dtn/lookups/news/config.rb', line 16

def call(format_type: DEFAULT_NEWS_FORMAT_TYPE)
  self.combined_options = defaults.merge(
    format_type: validate_format_type(format_type)
  )
  super
end