Class: NoSE::Serialize::SearchResultRepresenter
- Inherits:
-
Representable::Decorator
- Object
- Representable::Decorator
- NoSE::Serialize::SearchResultRepresenter
- Extended by:
- Forwardable
- Includes:
- Representable::Hash, Representable::JSON, Representable::Uncached, Representable::YAML
- Defined in:
- lib/nose/serialize.rb
Overview
Represent results of a search operation
Instance Method Summary collapse
-
#command ⇒ String
The full command used to generate the results.
-
#cost_model ⇒ Hash
The backend cost model used to generate the schema.
-
#cost_model=(options) ⇒ void
Look up the cost model by name and attach to the results.
-
#revision ⇒ String
Include the revision of the code used to generate this output.
-
#time ⇒ Time
The time the results were generated.
-
#time=(time) ⇒ void
Reconstruct the time object from the timestamp.
Methods included from Representable::Uncached
Instance Method Details
#command ⇒ String
The full command used to generate the results
752 753 754 |
# File 'lib/nose/serialize.rb', line 752 def command "#{$PROGRAM_NAME} #{ARGV.join ' '}" end |
#cost_model ⇒ Hash
The backend cost model used to generate the schema
703 704 705 706 707 |
# File 'lib/nose/serialize.rb', line 703 def cost_model = represented.cost_model.instance_variable_get(:@options) [:name] = represented.cost_model.subtype_name end |
#cost_model=(options) ⇒ void
This method returns an undefined value.
Look up the cost model by name and attach to the results
711 712 713 714 715 |
# File 'lib/nose/serialize.rb', line 711 def cost_model=() = .deep_symbolize_keys cost_model_class = Cost::Cost.subtype_class([:name]) represented.cost_model = cost_model_class.new(**) end |
#revision ⇒ String
Include the revision of the code used to generate this output
730 731 732 |
# File 'lib/nose/serialize.rb', line 730 def revision `git rev-parse HEAD 2> /dev/null`.strip end |
#time ⇒ Time
The time the results were generated
738 739 740 |
# File 'lib/nose/serialize.rb', line 738 def time Time.now.rfc2822 end |
#time=(time) ⇒ void
This method returns an undefined value.
Reconstruct the time object from the timestamp
744 745 746 |
# File 'lib/nose/serialize.rb', line 744 def time=(time) represented.time = Time.rfc2822 time end |