Class: Hyperion::ResultMaker

Inherits:
Object
  • Object
show all
Includes:
Formats, Logger
Defined in:
lib/hyperion/result_handling/result_maker.rb

Overview

Produces a hyperion result object from a typhoeus result object

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Logger

#log_result, #log_stub, #logger, #with_request_logging

Methods included from Formats

get_from, #read, #write

Constructor Details

#initialize(route) ⇒ ResultMaker

Returns a new instance of ResultMaker.



16
17
18
# File 'lib/hyperion/result_handling/result_maker.rb', line 16

def initialize(route)
  @route = route
end

Class Method Details

.make(route, typho_result, continuation = nil) ⇒ Object



12
13
14
# File 'lib/hyperion/result_handling/result_maker.rb', line 12

def self.make(route, typho_result, continuation=nil)
  self.new(route).make(typho_result, continuation)
end

Instance Method Details

#make(typho_result, continuation = nil) ⇒ Object



20
21
22
23
24
25
26
27
28
# File 'lib/hyperion/result_handling/result_maker.rb', line 20

def make(typho_result, continuation=nil)
  if continuation
    result = make_from_typho(typho_result, DispatchingHyperionResult)
    result.__set_escape_continuation__(continuation)
    result
  else
    make_from_typho(typho_result, HyperionResult)
  end
end