Module: Diffbot::Configurable
- Included in:
- Diffbot
- Defined in:
- lib/diffbot_api/configurable.rb
Overview
Configuration options for Diffbot
Constant Summary collapse
- DEFAULT_API_ENDPOINT =
Default API endpoint
"http://api.diffbot.com"
- DEFAULT_API_VERSION =
Default API version
"v2"
Instance Attribute Summary collapse
-
#api_endpoint ⇒ String
Base URL for API requests.
-
#api_version ⇒ String
Base URL for API requests.
-
#token ⇒ String
Access token for API requests.
Instance Method Summary collapse
-
#configure {|_self| ... } ⇒ Object
Set configurable options using a block.
-
#setup! ⇒ Object
Set configuration options to default values.
Instance Attribute Details
#api_endpoint ⇒ String
Returns Base URL for API requests. default: api.diffbot.com.
18 19 20 |
# File 'lib/diffbot_api/configurable.rb', line 18 def api_endpoint @api_endpoint end |
#api_version ⇒ String
Returns Base URL for API requests. default: 2.
18 |
# File 'lib/diffbot_api/configurable.rb', line 18 attr_accessor :api_endpoint, :api_version, :token |
#token ⇒ String
Returns Access token for API requests.
18 |
# File 'lib/diffbot_api/configurable.rb', line 18 attr_accessor :api_endpoint, :api_version, :token |
Instance Method Details
#configure {|_self| ... } ⇒ Object
Set configurable options using a block
21 22 23 |
# File 'lib/diffbot_api/configurable.rb', line 21 def configure yield self end |
#setup! ⇒ Object
Set configuration options to default values
26 27 28 29 |
# File 'lib/diffbot_api/configurable.rb', line 26 def setup! instance_variable_set(:@api_endpoint, DEFAULT_API_ENDPOINT) instance_variable_set(:@api_version, DEFAULT_API_VERSION) end |