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
- #next_searcher ⇒ Object
- #next_searcher? ⇒ Boolean
- #previous_searcher ⇒ Object
- #previous_searcher? ⇒ Boolean
Instance Attribute Details
#resources ⇒ Object (readonly)
Returns the value of attribute resources.
53 54 55 |
# File 'lib/ledger_sync/result.rb', line 53 def resources @resources end |
#searcher ⇒ Object (readonly)
Returns the value of attribute searcher.
53 54 55 |
# File 'lib/ledger_sync/result.rb', line 53 def searcher @searcher end |
Class Method Details
.included(base) ⇒ Object
55 56 57 58 59 60 61 62 63 64 |
# File 'lib/ledger_sync/result.rb', line 55 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
66 67 68 69 70 |
# File 'lib/ledger_sync/result.rb', line 66 def initialize(*args, searcher:, **keywords) @resources = searcher.resources @searcher = searcher super(*args, **keywords) end |
#next_searcher ⇒ Object
72 73 74 |
# File 'lib/ledger_sync/result.rb', line 72 def next_searcher searcher.next_searcher end |
#next_searcher? ⇒ Boolean
76 77 78 |
# File 'lib/ledger_sync/result.rb', line 76 def next_searcher? !next_searcher.nil? end |
#previous_searcher ⇒ Object
80 81 82 |
# File 'lib/ledger_sync/result.rb', line 80 def previous_searcher searcher.previous_searcher end |
#previous_searcher? ⇒ Boolean
84 85 86 |
# File 'lib/ledger_sync/result.rb', line 84 def previous_searcher? !previous_searcher.nil? end |