Class: RemoteFactoryGirl::RemotesConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/remote_factory_girl/remotes_config.rb

Constant Summary collapse

DEFAULT_REMOTE_NAME =
:default

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRemotesConfig

Returns a new instance of RemotesConfig.



13
14
15
# File 'lib/remote_factory_girl/remotes_config.rb', line 13

def initialize
  @remotes = {}
end

Instance Attribute Details

#current_remoteObject



17
18
19
# File 'lib/remote_factory_girl/remotes_config.rb', line 17

def current_remote
  @current_remote || default_remote_name
end

#remotesObject Also known as: to_hash

Returns the value of attribute remotes.



7
8
9
# File 'lib/remote_factory_girl/remotes_config.rb', line 7

def remotes
  @remotes
end

Instance Method Details

#default_remote_nameObject



21
22
23
# File 'lib/remote_factory_girl/remotes_config.rb', line 21

def default_remote_name
  DEFAULT_REMOTE_NAME
end

#reset(config = Config.new) ⇒ Object



25
26
27
28
# File 'lib/remote_factory_girl/remotes_config.rb', line 25

def reset(config = Config.new)
  self.current_remote = default_remote_name
  self.remotes        = { default_remote_name => config}
end