Class: Fog::Rackspace::NetworkingV2::Mock
- Includes:
- MockData
- Defined in:
- lib/fog/rackspace/networking_v2.rb
Constant Summary
Constants included from MockData
Instance Method Summary collapse
-
#initialize(options) ⇒ Mock
constructor
A new instance of Mock.
- #request(params) ⇒ Object
- #response(params = {}) ⇒ Object
Methods included from MockData
#data, ipv4_address, ipv6_address, keep, slice, stringify, uuid, zulu_time
Methods inherited from Service
#authenticate, #endpoint_uri, #region, #request_without_retry, #service_name, #service_net?
Constructor Details
#initialize(options) ⇒ Mock
Returns a new instance of Mock.
96 97 98 |
# File 'lib/fog/rackspace/networking_v2.rb', line 96 def initialize() @rackspace_api_key = [:rackspace_api_key] end |
Instance Method Details
#request(params) ⇒ Object
100 101 102 |
# File 'lib/fog/rackspace/networking_v2.rb', line 100 def request(params) Fog::Mock.not_implemented end |
#response(params = {}) ⇒ Object
104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/fog/rackspace/networking_v2.rb', line 104 def response(params={}) body = params[:body] || {} status = params[:status] || 200 headers = params[:headers] || {} response = Excon::Response.new(:body => body, :headers => headers, :status => status) if params.key?(:expects) && ![*params[:expects]].include?(response.status) raise(Excon::Errors.status_error(params, response)) else response end end |