Class: Typhoeus::HydraMock

Inherits:
Object
  • Object
show all
Defined in:
lib/typhoeus/hydra.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url, method) ⇒ HydraMock

Returns a new instance of HydraMock.



139
140
141
142
143
# File 'lib/typhoeus/hydra.rb', line 139

def initialize(url, method)
  @url      = url
  @method   = method
  @requests = []
end

Instance Attribute Details

#methodObject (readonly)

Returns the value of attribute method.



137
138
139
# File 'lib/typhoeus/hydra.rb', line 137

def method
  @method
end

#requestsObject (readonly)

Returns the value of attribute requests.



137
138
139
# File 'lib/typhoeus/hydra.rb', line 137

def requests
  @requests
end

#responseObject (readonly)

Returns the value of attribute response.



137
138
139
# File 'lib/typhoeus/hydra.rb', line 137

def response
  @response
end

#urlObject (readonly)

Returns the value of attribute url.



137
138
139
# File 'lib/typhoeus/hydra.rb', line 137

def url
  @url
end

Instance Method Details

#add_request(request) ⇒ Object



145
146
147
# File 'lib/typhoeus/hydra.rb', line 145

def add_request(request)
  @requests << request
end

#and_return(val) ⇒ Object



149
150
151
# File 'lib/typhoeus/hydra.rb', line 149

def and_return(val)
  @response = val
end