Module: RediSearch::LazilyLoad

Extended by:
Forwardable
Includes:
Enumerable
Included in:
Aggregate, Search, Spellcheck
Defined in:
lib/redi_search/lazily_load.rb

Instance Method Summary collapse

Instance Method Details

#inspectObject



25
26
27
28
29
30
31
# File 'lib/redi_search/lazily_load.rb', line 25

def inspect
  execute_and_rescue_inspection do
    return super unless valid?

    documents
  end
end

#loaded?Boolean

Returns:

  • (Boolean)


11
12
13
14
15
# File 'lib/redi_search/lazily_load.rb', line 11

def loaded?
  @loaded = false unless defined? @loaded

  @loaded
end

#pretty_print(printer) ⇒ Object

:nocov:



34
35
36
37
38
39
40
# File 'lib/redi_search/lazily_load.rb', line 34

def pretty_print(printer)
  execute_and_rescue_inspection do
    return super(inspect) unless valid?

    printer.pp(documents)
  end
end

#to_aObject Also known as: load



17
18
19
20
21
# File 'lib/redi_search/lazily_load.rb', line 17

def to_a
  execute unless loaded?

  documents
end