Class: EmmyHttp::Request

Inherits:
Object
  • Object
show all
Includes:
ModelPack::Document
Defined in:
lib/emmy_http/request.rb

Instance Method Summary collapse

Instance Method Details

#awaitObject



53
54
55
# File 'lib/emmy_http/request.rb', line 53

def await
  operation.await
end

#new_operationObject



47
48
49
# File 'lib/emmy_http/request.rb', line 47

def new_operation
  EmmyHttp::Operation.new(self, adapter.new)
end

#operationObject Also known as: op



43
44
45
# File 'lib/emmy_http/request.rb', line 43

def operation
  @operation ||= new_operation
end

#real_pathObject



65
66
67
68
69
70
71
72
# File 'lib/emmy_http/request.rb', line 65

def real_path
  return nil unless path
  if path.is_a?(Addressable::Template)
    path.expand(params)
  else
    Addressable::URI.parse(path.to_s)
  end
end

#real_urlObject



57
58
59
60
61
62
63
# File 'lib/emmy_http/request.rb', line 57

def real_url
  if url.is_a?(Addressable::Template)
    url.expand(params)
  else
    Addressable::URI.parse(url.to_s)
  end
end