Class: OpenfigiRuby::MappingResult
- Inherits:
-
Struct
- Object
- Struct
- OpenfigiRuby::MappingResult
- Defined in:
- lib/openfigi_ruby/mapping_result.rb
Overview
Result for a single job in a bulk mapping request.
On success, #data is an array of FigiResult objects and #warning is nil. When no match is found, #data is nil and #warning holds the API message.
Instance Attribute Summary collapse
-
#data ⇒ Array<FigiResult>?
readonly
Matched instruments, or nil when no match was found.
-
#warning ⇒ String?
readonly
API warning message when no identifier was found.
Instance Method Summary collapse
-
#found? ⇒ Boolean
Returns true if the job matched at least one instrument.
Instance Attribute Details
#data ⇒ Array<FigiResult>? (readonly)
Returns matched instruments, or nil when no match was found.
13 14 15 16 17 18 19 |
# File 'lib/openfigi_ruby/mapping_result.rb', line 13 MappingResult = Struct.new(:data, :warning, keyword_init: true) do # Returns true if the job matched at least one instrument. # @return [Boolean] def found? !data.nil? && !data.empty? end end |
#warning ⇒ String? (readonly)
Returns API warning message when no identifier was found.
13 14 15 16 17 18 19 |
# File 'lib/openfigi_ruby/mapping_result.rb', line 13 MappingResult = Struct.new(:data, :warning, keyword_init: true) do # Returns true if the job matched at least one instrument. # @return [Boolean] def found? !data.nil? && !data.empty? end end |
Instance Method Details
#found? ⇒ Boolean
Returns true if the job matched at least one instrument.
16 17 18 |
# File 'lib/openfigi_ruby/mapping_result.rb', line 16 def found? !data.nil? && !data.empty? end |