Class: FetchUtil::SearchTransport::Candidate
- Inherits:
-
Data
- Object
- Data
- FetchUtil::SearchTransport::Candidate
- Defined in:
- lib/fetch_util/search_transport.rb
Instance Attribute Summary collapse
-
#snippet ⇒ Object
readonly
Returns the value of attribute snippet.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#source_rank ⇒ Object
readonly
Returns the value of attribute source_rank.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(source:, title:, url:, source_rank:, snippet: nil) ⇒ Candidate
constructor
A new instance of Candidate.
Constructor Details
#initialize(source:, title:, url:, source_rank:, snippet: nil) ⇒ Candidate
Returns a new instance of Candidate.
15 16 17 18 |
# File 'lib/fetch_util/search_transport.rb', line 15 def initialize(source:, title:, url:, source_rank:, snippet: nil) super(source: source.to_s.freeze, title: title.to_s.freeze, url: url.to_s.freeze, snippet: snippet&.to_s&.freeze, source_rank: Integer(source_rank)) end |
Instance Attribute Details
#snippet ⇒ Object (readonly)
Returns the value of attribute snippet
14 15 16 |
# File 'lib/fetch_util/search_transport.rb', line 14 def snippet @snippet end |
#source ⇒ Object (readonly)
Returns the value of attribute source
14 15 16 |
# File 'lib/fetch_util/search_transport.rb', line 14 def source @source end |
#source_rank ⇒ Object (readonly)
Returns the value of attribute source_rank
14 15 16 |
# File 'lib/fetch_util/search_transport.rb', line 14 def source_rank @source_rank end |
#title ⇒ Object (readonly)
Returns the value of attribute title
14 15 16 |
# File 'lib/fetch_util/search_transport.rb', line 14 def title @title end |
#url ⇒ Object (readonly)
Returns the value of attribute url
14 15 16 |
# File 'lib/fetch_util/search_transport.rb', line 14 def url @url end |