Class: Vercellus::Configuration

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

Overview

Adds global configuration settings to the gem, including:

  • config.token - your Vercel token

To request token for Vercel, sign up for a free Vercel account and visit this page for instructions: https://vercel.com/account/tokens

Required fields

The following fields are required to use the gem:

  • Token

The gem will raise a Errors::Configuration if you fail to provide these keys.

Configuring your gem

Vercellus.configure do |config|
  config.token = ''
end

Accessing configuration settings

All settings are available on the Vercellus.configuration object:

Vercellus.configuration.token

Resetting configuration

To reset, simply call Vercellus.reset.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration



41
42
43
# File 'lib/vercellus/configuration.rb', line 41

def initialize
  @token = nil
end

Instance Attribute Details

#tokenObject



45
46
47
48
49
# File 'lib/vercellus/configuration.rb', line 45

def token
  raise Errors::Configuration, "Vercellus token missing!" unless @token

  @token
end