Class: Dtn::Lookups::News::Headline
- Defined in:
- lib/dtn/lookups/news/headline.rb
Overview
News headlines
Constant Summary collapse
- TEMPLATE =
"NHL,%<sources>s,%<symbols>s,%<format_type>s,%<limit>d,%<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
Instance Method Summary collapse
-
#call(date_range: "", symbols: [], sources: [], format_type: DEFAULT_NEWS_FORMAT_TYPE, limit: DEFAULT_NEWS_HEADLINES_LIMIT) ⇒ Object
Returns all current news headlines.
Methods inherited from Request
Methods included from Concerns::Id
Instance Method Details
#call(date_range: "", symbols: [], sources: [], format_type: DEFAULT_NEWS_FORMAT_TYPE, limit: DEFAULT_NEWS_HEADLINES_LIMIT) ⇒ Object
Returns all current news headlines.
Example messages
NHL,[Sources],[Symbols],[XML/Text],[Limit],[Date],[RequestID]
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/dtn/lookups/news/headline.rb', line 26 def call(date_range: "", symbols: [], sources: [], format_type: DEFAULT_NEWS_FORMAT_TYPE, limit: DEFAULT_NEWS_HEADLINES_LIMIT) self. = defaults.merge( format_type: validate_format_type(format_type), symbols: validate_list(symbols), sources: validate_list(sources), date_range: validate_date_ranges(date_range), limit: limit ) super end |