Class: BrasilfoneAPI::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/brasilfone_api/configuration.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#passwordObject

Returns the value of attribute password.



3
4
5
# File 'lib/brasilfone_api/configuration.rb', line 3

def password
  @password
end

#usernameObject

Returns the value of attribute username.



3
4
5
# File 'lib/brasilfone_api/configuration.rb', line 3

def username
  @username
end

Class Method Details

.configObject



11
12
13
# File 'lib/brasilfone_api/configuration.rb', line 11

def self.config
  @config || configure
end

.configure {|@config| ... } ⇒ Object

Yields:



5
6
7
8
9
# File 'lib/brasilfone_api/configuration.rb', line 5

def self.configure
  @config ||= Configuration.new
  yield(@config) if block_given?
  @config
end

.resetObject



15
16
17
18
19
# File 'lib/brasilfone_api/configuration.rb', line 15

def self.reset
  @config || configure
  config.username = nil
  config.password = nil
end