Class: AlphabeticalSearchResult
- Inherits:
-
Object
- Object
- AlphabeticalSearchResult
show all
- Defined in:
- app/presenters/alphabetical_search_result.rb
Instance Method Summary
collapse
Constructor Details
Returns a new instance of AlphabeticalSearchResult.
4
5
6
|
# File 'app/presenters/alphabetical_search_result.rb', line 4
def initialize(pref_labeling)
@labeling = pref_labeling
end
|
Instance Method Details
#concept ⇒ Object
12
13
14
|
# File 'app/presenters/alphabetical_search_result.rb', line 12
def concept
@labeling.owner
end
|
#definition ⇒ Object
25
26
27
28
|
# File 'app/presenters/alphabetical_search_result.rb', line 25
def definition
relation_name = Note::SKOS::Definition.name.to_relation_name
@labeling.owner.send(relation_name).first
end
|
#definition? ⇒ Boolean
20
21
22
23
|
# File 'app/presenters/alphabetical_search_result.rb', line 20
def definition?
relation_name = Note::SKOS::Definition.name.to_relation_name
@labeling.owner.respond_to?(relation_name) && @labeling.owner.send(relation_name).any?
end
|
#label ⇒ Object
8
9
10
|
# File 'app/presenters/alphabetical_search_result.rb', line 8
def label
@labeling.target
end
|
#partial_name ⇒ Object
30
31
32
|
# File 'app/presenters/alphabetical_search_result.rb', line 30
def partial_name
'concepts/alphabetical/search_result'
end
|
#path ⇒ Object
16
17
18
|
# File 'app/presenters/alphabetical_search_result.rb', line 16
def path
url_helpers.rdf_path(@labeling.owner.origin, lang: nil, format: nil)
end
|