Class: FetchUtil::SearchTransport::Candidate

Inherits:
Data
  • Object
show all
Defined in:
lib/fetch_util/search_transport.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#snippetObject (readonly)

Returns the value of attribute snippet

Returns:

  • (Object)

    the current value of snippet



14
15
16
# File 'lib/fetch_util/search_transport.rb', line 14

def snippet
  @snippet
end

#sourceObject (readonly)

Returns the value of attribute source

Returns:

  • (Object)

    the current value of source



14
15
16
# File 'lib/fetch_util/search_transport.rb', line 14

def source
  @source
end

#source_rankObject (readonly)

Returns the value of attribute source_rank

Returns:

  • (Object)

    the current value of source_rank



14
15
16
# File 'lib/fetch_util/search_transport.rb', line 14

def source_rank
  @source_rank
end

#titleObject (readonly)

Returns the value of attribute title

Returns:

  • (Object)

    the current value of title



14
15
16
# File 'lib/fetch_util/search_transport.rb', line 14

def title
  @title
end

#urlObject (readonly)

Returns the value of attribute url

Returns:

  • (Object)

    the current value of url



14
15
16
# File 'lib/fetch_util/search_transport.rb', line 14

def url
  @url
end