Module: RandomUserGenerator::Configuration

Included in:
RandomUserGenerator
Defined in:
lib/random_user_generator/configuration.rb

Constant Summary collapse

OPTIONS =
[:key, :nat, :gender, :seed]

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#api_versionObject

Returns the value of attribute api_version.



5
6
7
# File 'lib/random_user_generator/configuration.rb', line 5

def api_version
  @api_version
end

Instance Method Details

#configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



8
9
10
# File 'lib/random_user_generator/configuration.rb', line 8

def configure
  yield self
end

#optionsObject



12
13
14
15
16
# File 'lib/random_user_generator/configuration.rb', line 12

def options
  OPTIONS.inject({}) do |option, key|
    option.merge!(key => send(key))
  end
end

#resetObject



18
19
20
21
22
23
24
# File 'lib/random_user_generator/configuration.rb', line 18

def reset
  self.api_version = nil
  self.key         = nil
  self.nat         = nil
  self.gender      = nil
  self.seed        = nil
end