Module: RediSearch::Document::Display
- Included in:
- RediSearch::Document
- Defined in:
- lib/redi_search/document/display.rb
Instance Method Summary collapse
Instance Method Details
#inspect ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/redi_search/document/display.rb', line 6 def inspect inspection = pretty_print_attributes.filter_map do |field_name| "#{field_name}: #{public_send(field_name)}" end.join(", ") "#<#{self.class} #{inspection}>" end |
#pretty_print(printer) ⇒ Object
:nocov:
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/redi_search/document/display.rb', line 23 def pretty_print(printer) # rubocop:disable Metrics/MethodLength printer.object_address_group(self) do printer.seplist( pretty_print_attributes , proc { printer.text "," } ) do |field_name| printer.breakable " " printer.group(1) do printer.text field_name printer.text ":" printer.breakable printer.pp public_send(field_name) end end end end |
#pretty_print_attributes ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/redi_search/document/display.rb', line 14 def pretty_print_attributes pp_attrs = attributes.keys.dup pp_attrs.push("document_id") pp_attrs.push("score") if score pp_attrs.compact end |