Sha256: 3bd30043028d65e5348e45710a2d0f37712b7f534d6066dbcf35bff2b13db1df

Contents?: true

Size: 475 Bytes

Versions: 5

Compression:

Stored size: 475 Bytes

Contents

module Sms50X
  module Configuration

    DEFAULTS = {
      api_key: nil,
      country_code: 'CRI'
    }

    DEFAULTS.each_key do |attribute|
      attr_accessor attribute
    end

    # Make sure we have the default values set when we get 'extended'
    def self.extended(base)
      base.reset
    end

    def reset
      self.api_key = DEFAULTS[:api_key]
      self.country_code = DEFAULTS[:country_code]
    end

    def configure
      yield self
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
sms50X-ruby-0.4.1 lib/sms50X/configuration.rb
sms50X-ruby-0.4.0 lib/sms50X/configuration.rb
sms50X-ruby-0.3.0 lib/sms50X/configuration.rb
sms50X-ruby-0.2.0 lib/sms50X/configuration.rb
sms50X-ruby-0.1.0 lib/sms50X/configuration.rb