Class: Dtn::Lookups::News::StoryCount

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

Overview

News story count

Constant Summary collapse

TEMPLATE =
"NSC,%<symbols>s,%<format_type>s,%<sources>s,%<date_range>s,%<id>d"
DEFAULT_NEWS_HEADLINES_LIMIT =
1000

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(date_range: "", symbols: [], sources: [], format_type: DEFAULT_NEWS_FORMAT_TYPE) ⇒ Object

Returns all current news headlines.

Example messages

NSC,[Symbols],[XML/Text],[Sources],[DateRange],[RequestID]<CR>


24
25
26
27
28
29
30
31
32
# File 'lib/dtn/lookups/news/story_count.rb', line 24

def call(date_range: "", symbols: [], sources: [], format_type: DEFAULT_NEWS_FORMAT_TYPE)
  self.combined_options = defaults.merge(
    format_type: validate_format_type(format_type),
    symbols: validate_list(symbols),
    sources: validate_list(sources),
    date_range: validate_date_ranges(date_range)
  )
  super
end