Class: AlphabeticalSearchResultRemote
- Inherits:
-
AlphabeticalSearchResult
- Object
- AlphabeticalSearchResult
- AlphabeticalSearchResultRemote
- Defined in:
- app/presenters/alphabetical_search_result_remote.rb
Instance Method Summary collapse
- #definition ⇒ Object
- #definition? ⇒ Boolean
- #definition_language ⇒ Object
-
#initialize(host, path, label, options = {}) ⇒ AlphabeticalSearchResultRemote
constructor
A new instance of AlphabeticalSearchResultRemote.
- #label ⇒ Object
- #partial_name ⇒ Object
- #path ⇒ Object
- #url ⇒ Object
Methods inherited from AlphabeticalSearchResult
Constructor Details
#initialize(host, path, label, options = {}) ⇒ AlphabeticalSearchResultRemote
Returns a new instance of AlphabeticalSearchResultRemote.
2 3 4 5 6 7 8 9 |
# File 'app/presenters/alphabetical_search_result_remote.rb', line 2 def initialize(host, path, label, = {}) @host = host @path = path @label = label @definition = [:definition] @definition_language = [:definition_language] @additional_info = [:additional_info] end |
Instance Method Details
#definition ⇒ Object
31 32 33 |
# File 'app/presenters/alphabetical_search_result_remote.rb', line 31 def definition @definition end |
#definition? ⇒ Boolean
27 28 29 |
# File 'app/presenters/alphabetical_search_result_remote.rb', line 27 def definition? @definition.present? end |
#definition_language ⇒ Object
35 36 37 |
# File 'app/presenters/alphabetical_search_result_remote.rb', line 35 def definition_language @definition_language end |
#label ⇒ Object
11 12 13 14 15 16 17 |
# File 'app/presenters/alphabetical_search_result_remote.rb', line 11 def label if @additional_info.present? "#{@label} #{@additional_info}" else @label end end |
#partial_name ⇒ Object
39 40 41 |
# File 'app/presenters/alphabetical_search_result_remote.rb', line 39 def partial_name 'concepts/alphabetical/search_result_remote' end |
#path ⇒ Object
19 20 21 |
# File 'app/presenters/alphabetical_search_result_remote.rb', line 19 def path @path end |
#url ⇒ Object
23 24 25 |
# File 'app/presenters/alphabetical_search_result_remote.rb', line 23 def url URI.join(@host, @path).to_s end |