Module: FactoryGirl::RemoteApi

Defined in:
lib/factory_girl/remote_api.rb,
lib/factory_girl/remote_api/engine.rb,
lib/factory_girl/remote_api/request.rb,
lib/factory_girl/remote_api/version.rb,
lib/factory_girl/remote_api/configuration.rb,
lib/factory_girl/remote_api/remote_factory.rb,
app/helpers/factory_girl/remote_api/application_helper.rb,
app/controllers/factory_girl/remote_api/factories_controller.rb,
app/controllers/factory_girl/remote_api/application_controller.rb

Defined Under Namespace

Modules: ApplicationHelper Classes: ApplicationController, Configuration, Engine, FactoriesController, RemoteFactory, Request

Constant Summary collapse

VERSION =
'0.4.1'

Class Method Summary collapse

Class Method Details

.attributes_for(factory, attributes = {}) ⇒ Object



30
31
32
# File 'lib/factory_girl/remote_api.rb', line 30

def self.attributes_for(factory, attributes = {})
  FactoryGirl::RemoteApi::Request.new.get_response_for(:attributes_for, factory, attributes)
end

.build(factory, attributes = {}) ⇒ Object



26
27
28
# File 'lib/factory_girl/remote_api.rb', line 26

def self.build(factory, attributes = {})
  FactoryGirl::RemoteApi::RemoteFactory.model_from(:build, factory, attributes)
end

.configurationObject



14
15
16
# File 'lib/factory_girl/remote_api.rb', line 14

def self.configuration
  @configuration ||= FactoryGirl::RemoteApi::Configuration.new
end

.configure {|configuration| ... } ⇒ Object

Yields:



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

def self.configure
  yield configuration if block_given?
end

.create(factory, attributes = {}) ⇒ Object



22
23
24
# File 'lib/factory_girl/remote_api.rb', line 22

def self.create(factory, attributes = {})
  FactoryGirl::RemoteApi::RemoteFactory.model_from(:create, factory, attributes)
end

.created_attributes_for(factory, attributes = {}) ⇒ Object



34
35
36
# File 'lib/factory_girl/remote_api.rb', line 34

def self.created_attributes_for(factory, attributes = {})
  FactoryGirl::RemoteApi::Request.new.get_response_for(:create, factory, attributes)
end

.reset_configurationObject



18
19
20
# File 'lib/factory_girl/remote_api.rb', line 18

def self.reset_configuration
  @configuration = nil
end