Class: Dtn::Lookups::News::Story

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

Overview

News story

Constant Summary collapse

NEWS_FORMAT_TYPES =
%w[x t e].freeze
TEMPLATE =
"NSY,%<story_id>s,%<format_type>s,%<deliver_to>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(story_id:, deliver_to: nil, format_type: DEFAULT_NEWS_FORMAT_TYPE) ⇒ Object

Returns all current news story.

Note: email support was not implemented

Example messages

NSY,[ID],[XML/Text/Email],[DeliverTo],[RequestID]<CR><LF>


19
20
21
22
23
24
25
26
# File 'lib/dtn/lookups/news/story.rb', line 19

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