Class: Dtn::Lookups::Request
- Inherits:
-
Object
- Object
- Dtn::Lookups::Request
- Includes:
- Concerns::Id
- Defined in:
- lib/dtn/lookups/request.rb
Overview
Lookups are used to get historical data from IQFeed’s lookup socket. This class returns historical data as the return value from the function used to request the data.
Works synchronously
For more details see: www.iqfeed.net/dev/api/docs/HistoricalviaTCPIP.cfm
Direct Known Subclasses
Catalog::ListedMarkets, Catalog::NaicCodes, Catalog::SecurityTypes, Catalog::SicCodes, Catalog::TradeConditions, Historical::Base, News::Base, Symbol::Base
Constant Summary collapse
- END_OF_MESSAGE_CHARACTERS =
/!ENDMSG!/.freeze
- NO_DATA_CHARACTERS =
/!NO_DATA!/.freeze
- SYNTAX_ERROR_CHARACTERS =
/!SYNTAX_ERROR!/.freeze
- PORT =
9100
Instance Attribute Summary collapse
-
#combined_options ⇒ Object
Returns the value of attribute combined_options.
Class Method Summary collapse
Instance Method Summary collapse
-
#call(&blk) ⇒ Object
Initialize the request to api, should be used in children classes only.
Methods included from Concerns::Id
Instance Attribute Details
#combined_options ⇒ Object
Returns the value of attribute combined_options.
28 29 30 |
# File 'lib/dtn/lookups/request.rb', line 28 def @combined_options end |
Class Method Details
.call(*args, **opts, &blk) ⇒ Object
23 24 25 |
# File 'lib/dtn/lookups/request.rb', line 23 def call(*args, **opts, &blk) new.call(*args, **opts, &blk) end |
Instance Method Details
#call(&blk) ⇒ Object
Initialize the request to api, should be used in children classes only
33 34 35 36 37 38 39 |
# File 'lib/dtn/lookups/request.rb', line 33 def call(*, &blk) socket.print "#{format(self.class.const_get(:TEMPLATE), )}\r\n" pull_socket(&blk) return result_accumulator unless block_given? end |