Class: FetchUtil::SearchTransport::SourceResponse

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:, status:, elapsed_ms:, transport: "http", candidates: [], final_url: nil, reason: nil) ⇒ SourceResponse

Returns a new instance of SourceResponse.



22
23
24
25
26
# File 'lib/fetch_util/search_transport.rb', line 22

def initialize(source:, status:, elapsed_ms:, transport: "http", candidates: [], final_url: nil, reason: nil)
  super(source: source.to_s.freeze, transport: transport.to_s.freeze, status: status.to_s.freeze,
        candidates: candidates.freeze, elapsed_ms: Integer(elapsed_ms), final_url: final_url&.to_s&.freeze,
        reason: reason&.to_s&.freeze)
end

Instance Attribute Details

#candidatesObject (readonly)

Returns the value of attribute candidates

Returns:

  • (Object)

    the current value of candidates



21
22
23
# File 'lib/fetch_util/search_transport.rb', line 21

def candidates
  @candidates
end

#elapsed_msObject (readonly)

Returns the value of attribute elapsed_ms

Returns:

  • (Object)

    the current value of elapsed_ms



21
22
23
# File 'lib/fetch_util/search_transport.rb', line 21

def elapsed_ms
  @elapsed_ms
end

#final_urlObject (readonly)

Returns the value of attribute final_url

Returns:

  • (Object)

    the current value of final_url



21
22
23
# File 'lib/fetch_util/search_transport.rb', line 21

def final_url
  @final_url
end

#reasonObject (readonly)

Returns the value of attribute reason

Returns:

  • (Object)

    the current value of reason



21
22
23
# File 'lib/fetch_util/search_transport.rb', line 21

def reason
  @reason
end

#sourceObject (readonly)

Returns the value of attribute source

Returns:

  • (Object)

    the current value of source



21
22
23
# File 'lib/fetch_util/search_transport.rb', line 21

def source
  @source
end

#statusObject (readonly)

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



21
22
23
# File 'lib/fetch_util/search_transport.rb', line 21

def status
  @status
end

#transportObject (readonly)

Returns the value of attribute transport

Returns:

  • (Object)

    the current value of transport



21
22
23
# File 'lib/fetch_util/search_transport.rb', line 21

def transport
  @transport
end