Class: Yummly::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/yummly/configuration.rb

Overview

Configuration class that stores configuration options for the Yummly API.

Yummly requires an App ID and APP key combination to authenticate against its API. At the very least these must be supplied in the configuration.

Additionally for certain paid plans Yummly offers SSL API access, so setting the configuration option use_ssl to true will send all API calls over HTTPS. This options defaults to false.

Configuration options are typically set via the Yummly.config method.

Examples:

Yummly.configure do |config|
  config.app_id = "12345"
  config.app_key = "XXXXXXXXXXXXXXXXXXXXXXXX"
end

See Also:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Creates a configuration object, defaulting use_ssl to false.



23
24
25
# File 'lib/yummly/configuration.rb', line 23

def initialize
  @use_ssl  = false
end

Instance Attribute Details

#app_idObject

Returns the value of attribute app_id.



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

def app_id
  @app_id
end

#app_keyObject

Returns the value of attribute app_key.



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

def app_key
  @app_key
end

#use_sslObject

Returns the value of attribute use_ssl.



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

def use_ssl
  @use_ssl
end

Instance Method Details

#use_ssl?Boolean

Returns true if API calls to Yummly should use SSL.

Examples:

Yummly.configuration.use_ssl?

Returns:

  • (Boolean)

    true if API calls to Yummly should use SSL



32
33
34
# File 'lib/yummly/configuration.rb', line 32

def use_ssl?
  use_ssl
end