Sha256: a870f1192ebf5411bef392c57c4758992ec0c13a98ff67ceabb80198a333368e

Contents?: true

Size: 716 Bytes

Versions: 20

Compression:

Stored size: 716 Bytes

Contents

class AlphabeticalSearchResult
  delegate :url_helpers, to: 'Rails.application.routes'

  def initialize(pref_labeling)
    @labeling = pref_labeling
  end

  def label
    @labeling.target
  end

  def concept
    @labeling.owner
  end

  def path
    url_helpers.rdf_path(@labeling.owner.origin, lang: nil, format: nil)
  end

  def definition?
    relation_name = Note::SKOS::Definition.name.to_relation_name
    @labeling.owner.respond_to?(relation_name) && @labeling.owner.send(relation_name).any?
  end

  def definition
    relation_name = Note::SKOS::Definition.name.to_relation_name
    @labeling.owner.send(relation_name).first
  end

  def partial_name
    'concepts/alphabetical/search_result'
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
iqvoc-4.14.5 app/presenters/alphabetical_search_result.rb
iqvoc-4.14.4 app/presenters/alphabetical_search_result.rb
iqvoc-4.13.2 app/presenters/alphabetical_search_result.rb
iqvoc-4.13.0 app/presenters/alphabetical_search_result.rb
iqvoc-4.12.1 app/presenters/alphabetical_search_result.rb
iqvoc-4.12.0 app/presenters/alphabetical_search_result.rb
iqvoc-4.11.1 app/presenters/alphabetical_search_result.rb
iqvoc-4.11.0 app/presenters/alphabetical_search_result.rb
iqvoc-4.10.0 app/presenters/alphabetical_search_result.rb
iqvoc-4.9.0 app/presenters/alphabetical_search_result.rb
iqvoc-4.8.2 app/presenters/alphabetical_search_result.rb
iqvoc-4.8.1 app/presenters/alphabetical_search_result.rb
iqvoc-4.8.0 app/presenters/alphabetical_search_result.rb
iqvoc-4.7.0 app/presenters/alphabetical_search_result.rb
iqvoc-4.6.1 app/presenters/alphabetical_search_result.rb
iqvoc-4.5.2 app/presenters/alphabetical_search_result.rb
iqvoc-4.6.0 app/presenters/alphabetical_search_result.rb
iqvoc-4.5.1 app/presenters/alphabetical_search_result.rb
iqvoc-4.5.0 app/presenters/alphabetical_search_result.rb
iqvoc-4.4.0 app/presenters/alphabetical_search_result.rb