Class: TypeformData::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/typeform_data/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key:) ⇒ Config

Returns a new instance of Config.



6
7
8
9
10
11
# File 'lib/typeform_data/config.rb', line 6

def initialize(api_key:)
  unless api_key.is_a?(String) && api_key.length.positive?
    raise ArgumentError, 'An API key (as a nonempty String) is required'
  end
  @api_key = api_key
end

Instance Attribute Details

#api_keyObject (readonly)

Returns the value of attribute api_key.



4
5
6
# File 'lib/typeform_data/config.rb', line 4

def api_key
  @api_key
end

Instance Method Details

#==(other) ⇒ Object



27
28
29
# File 'lib/typeform_data/config.rb', line 27

def ==(other)
  other.api_key == api_key
end

#api_versionObject



23
24
25
# File 'lib/typeform_data/config.rb', line 23

def api_version
  1
end

#hostObject

These values were determined via URI.parse(‘api.typeform.com’).



15
16
17
# File 'lib/typeform_data/config.rb', line 15

def host
  'api.typeform.com'
end

#portObject



19
20
21
# File 'lib/typeform_data/config.rb', line 19

def port
  443
end