Class: Dtn::Lookups::Symbol::ByFilter

Inherits:
Base show all
Defined in:
lib/dtn/lookups/symbol/by_filter.rb

Overview

Symbol lookup by custom filter

Constant Summary collapse

TEMPLATE =
"SBF,%<field_to_search>s,%<search_line>s,%<filter_type>s,%<filter_value>s,%<id>d"

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(search_line:, **options) ⇒ Object

Symbols lookup by user filter.

Example messages

SBF,[Field To Search],[Search String],[Filter Type],[Filter Value],[RequestID]<CR><LF>


20
21
22
23
24
25
26
27
28
29
30
# File 'lib/dtn/lookups/symbol/by_filter.rb', line 20

def call(search_line:, **options)
  self.combined_options = defaults(**options).merge(
    {
      search_line: search_line,
      field_to_search: validate_field_to_search(options[:field_to_search]),
      filter_type: validate_filter_type(options[:filter_type]),
      filter_value: validate_filter_value(options[:filter_value], options[:filter_type])
    }
  )
  super
end