Class: TypeformData::Config
- Inherits:
-
Object
- Object
- TypeformData::Config
- Defined in:
- lib/typeform_data/config.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #api_version ⇒ Object
-
#host ⇒ Object
These values were determined via URI.parse(‘api.typeform.com’).
- #initialize(api_key:, logger: nil) ⇒ Config constructor
- #port ⇒ Object
Constructor Details
#initialize(api_key:, logger: nil) ⇒ Config
12 13 14 15 16 17 18 |
# File 'lib/typeform_data/config.rb', line 12 def initialize(api_key:, logger: nil) unless api_key.is_a?(String) && api_key.length.positive? raise TypeformData::ArgumentError, 'An API key (as a nonempty String) is required' end @api_key = api_key @logger = logger || Logger.new($stdout) end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
6 7 8 |
# File 'lib/typeform_data/config.rb', line 6 def api_key @api_key end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
7 8 9 |
# File 'lib/typeform_data/config.rb', line 7 def logger @logger end |
Instance Method Details
#==(other) ⇒ Object
34 35 36 |
# File 'lib/typeform_data/config.rb', line 34 def ==(other) other.api_key == api_key end |
#api_version ⇒ Object
30 31 32 |
# File 'lib/typeform_data/config.rb', line 30 def api_version 1 end |
#host ⇒ Object
These values were determined via URI.parse(‘api.typeform.com’).
22 23 24 |
# File 'lib/typeform_data/config.rb', line 22 def host 'api.typeform.com' end |
#port ⇒ Object
26 27 28 |
# File 'lib/typeform_data/config.rb', line 26 def port 443 end |