Sha256: b9e263b6a0a75c600b033a48f4acac53d33638b084440ed8a7ae582f556a2393

Contents?: true

Size: 491 Bytes

Versions: 3

Compression:

Stored size: 491 Bytes

Contents

module RandomUserGenerator
  module Configuration
    OPTIONS = [:key, :nat, :gender, :seed]

    attr_accessor :api_version
    attr_accessor *OPTIONS

    def configure
      yield self
    end

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

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
random_user_generator-0.2.1 lib/random_user_generator/configuration.rb
random_user_generator-0.2.0 lib/random_user_generator/configuration.rb
random_user_generator-0.1.0 lib/random_user_generator/configuration.rb