Class: FactoryGirl::RemoteApi::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/factory_girl/remote_api/request.rb

Instance Method Summary collapse

Instance Method Details

#get_response_for(factory_method, factory, attributes) ⇒ Object



8
9
10
11
12
# File 'lib/factory_girl/remote_api/request.rb', line 8

def get_response_for(factory_method, factory, attributes)
  uri = uri_for(factory_method, factory)
  uri.query = attributes_as_query(factory, attributes)
  parsed_response(Net::HTTP.get_response(uri).body, attributes[:parent_factory] || factory.to_s)
end