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.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #api_version ⇒ Object
-
#host ⇒ Object
These values were determined via URI.parse(‘api.typeform.com’).
-
#initialize(api_key:) ⇒ Config
constructor
A new instance of Config.
- #port ⇒ Object
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_key ⇒ Object (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_version ⇒ Object
23 24 25 |
# File 'lib/typeform_data/config.rb', line 23 def api_version 1 end |
#host ⇒ Object
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 |
#port ⇒ Object
19 20 21 |
# File 'lib/typeform_data/config.rb', line 19 def port 443 end |