Module: LedgerSync::SearchResult::ResultTypeBase
- Defined in:
- lib/ledger_sync/result.rb
Instance Attribute Summary collapse
-
#resources ⇒ Object
readonly
Returns the value of attribute resources.
-
#searcher ⇒ Object
readonly
Returns the value of attribute searcher.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(*args, searcher:, **keywords) ⇒ Object
rubocop:disable Lint/UnusedMethodArgument.
- #next_searcher ⇒ Object
- #next_searcher? ⇒ Boolean
- #previous_searcher ⇒ Object
- #previous_searcher? ⇒ Boolean
Instance Attribute Details
#resources ⇒ Object (readonly)
Returns the value of attribute resources.
59 60 61 |
# File 'lib/ledger_sync/result.rb', line 59 def resources @resources end |
#searcher ⇒ Object (readonly)
Returns the value of attribute searcher.
59 60 61 |
# File 'lib/ledger_sync/result.rb', line 59 def searcher @searcher end |
Class Method Details
.included(base) ⇒ Object
61 62 63 64 65 66 67 68 69 70 |
# File 'lib/ledger_sync/result.rb', line 61 def self.included(base) base.class_eval do # TODO: removed next and previous searcher, because it causes a string of them. # We should add next_searcher_params which would be easier to serialize. simply_serialize only: %i[ resources searcher ] end end |
Instance Method Details
#initialize(*args, searcher:, **keywords) ⇒ Object
rubocop:disable Lint/UnusedMethodArgument
72 73 74 75 76 |
# File 'lib/ledger_sync/result.rb', line 72 def initialize(*args, searcher:, **keywords) # rubocop:disable Lint/UnusedMethodArgument @resources = searcher.resources @searcher = searcher super(*args) end |
#next_searcher ⇒ Object
78 79 80 |
# File 'lib/ledger_sync/result.rb', line 78 def next_searcher searcher.next_searcher end |
#next_searcher? ⇒ Boolean
82 83 84 |
# File 'lib/ledger_sync/result.rb', line 82 def next_searcher? !next_searcher.nil? end |
#previous_searcher ⇒ Object
86 87 88 |
# File 'lib/ledger_sync/result.rb', line 86 def previous_searcher searcher.previous_searcher end |
#previous_searcher? ⇒ Boolean
90 91 92 |
# File 'lib/ledger_sync/result.rb', line 90 def previous_searcher? !previous_searcher.nil? end |