Class: Hyperion::ResultMaker

Inherits:
Object
  • Object
show all
Includes:
Formats
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 Formats

get_from, #read, #write

Methods included from Logger

#log_stub, #logger, #with_request_logging

Constructor Details

#initialize(route) ⇒ ResultMaker

Returns a new instance of ResultMaker.



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

def initialize(route)
  @route = route
end

Class Method Details

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



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

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



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

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