Sha256: 07ee09efca3d063e58eaec0f98ebff11e84a3623b17f5c8696c80b7743964b4b
Contents?: true
Size: 759 Bytes
Versions: 9
Compression:
Stored size: 759 Bytes
Contents
class SearchResult extend Forwardable attr_reader :result_object def_delegators :@result_object, :build_search_result_rdf, :owner, :target, :value, :label, :rdf_namespace, :rdf_predicate def initialize(result_object) @result_object = result_object end def model_name @result_object.class.model_name end def search_result_partial_name @result_object.class.search_result_partial_name end def language if @result_object.is_a?(Labeling::Base) @result_object.target.try(:language) else @result_object.try(:language) end end def to_s if @result_object.is_a?(Labeling::Base) @result_object.target.value else @result_object.try(:owner).try(:pref_label).to_s end end end
Version data entries
9 entries across 9 versions & 1 rubygems