Module: Typeform::Configuration

Included in:
Typeform
Defined in:
lib/typeform/configuration.rb

Overview

Defines constants and methods related to configuration.

Constant Summary collapse

OPTION_KEYS =

An array of valid keys in the options hash when configuring a Typeform::Client.

[:typeform_token, :timeout, :debug]
DEFAULT_USER_AGENT =

The user agent that will be sent to the API endpoint if none is set.

"Typeform Ruby Client Gem #{Typeform::VERSION}"
DEFAULT_API_BASE_URI =

Base URI for the Typeform API.

"https://api.typeform.com/"

Instance Method Summary collapse

Instance Method Details

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

Convenience method to allow configuration options to be set in a block.

Yields:

  • (_self)

Yield Parameters:



18
19
20
# File 'lib/typeform/configuration.rb', line 18

def configure
  yield(self)
end

#optionsObject

Creates a hash of options and their values.



23
24
25
26
27
# File 'lib/typeform/configuration.rb', line 23

def options
  options = {}
  OPTION_KEYS.each { |key| options[key] = send(key) }
  options
end