Class: CcipDirectoryAndConfigurationRestApiV1::SearchType
- Inherits:
-
Object
- Object
- CcipDirectoryAndConfigurationRestApiV1::SearchType
- Defined in:
- lib/ccip_directory_and_configuration_rest_api_v1/models/search_type.rb
Overview
The detected type of search query. ‘selector’ for CCIP selectors (>17 digits), ‘chainId’ for chain IDs (≤17 digits or Solana base58), ‘internalId’ for kebab-case identifiers, ‘displayName’ for fuzzy text search.
Constant Summary collapse
- SEARCH_TYPE =
[ # TODO: Write general description for SELECTOR SELECTOR = 'selector'.freeze, # TODO: Write general description for CHAINID CHAINID = 'chainId'.freeze, # TODO: Write general description for INTERNALID INTERNALID = 'internalId'.freeze, # TODO: Write general description for DISPLAYNAME DISPLAYNAME = 'displayName'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = SELECTOR) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/ccip_directory_and_configuration_rest_api_v1/models/search_type.rb', line 31 def self.from_value(value, default_value = SELECTOR) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'selector' then SELECTOR when 'chainid' then CHAINID when 'internalid' then INTERNALID when 'displayname' then DISPLAYNAME else default_value end end |
.validate(value) ⇒ Object
25 26 27 28 29 |
# File 'lib/ccip_directory_and_configuration_rest_api_v1/models/search_type.rb', line 25 def self.validate(value) return false if value.nil? SEARCH_TYPE.include?(value) end |