Module: Star::Config

Included in:
Star
Defined in:
lib/star/config.rb

Overview

Provides methods to read and write global configuration settings.

Note that Star.configure has precedence over values through with environment variables (see Configuration).

Examples:

Set the API key for a server-only YouTube app:

Star.configure do |config|
  config.access_key_id = 'ABCDEFGHIJ1234567890'
end

Instance Method Summary collapse

Instance Method Details

#configurationStar::Configuration

Returns the global Models::Configuration object.

While this method can be used to read and write configuration settings, it is easier to use #configure Star.configure}.

Examples:

Star.configuration.access_key_id = 'ABCDEFGHIJ1234567890'


41
42
43
# File 'lib/star/config.rb', line 41

def configuration
  @configuration ||= Star::Configuration.new
end

#configure {|Star::Configuration| ... } ⇒ Object

Yields the global configuration to the given block.

Examples:

Star.configure do |config|
  config.access_key_id = 'ABCDEFGHIJ1234567890'
end

Yields:



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

def configure
  yield configuration if block_given?
end

#remote?Boolean



28
29
30
# File 'lib/star/config.rb', line 28

def remote?
  !!configuration.remote
end