Class: ActiveShotgun::Config

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Singleton
Defined in:
lib/active_shotgun/config.rb

Constant Summary collapse

DEFAULT_CONFIG =
{
  shotgun_site_name: 'pasind3-prod',
  shotgun_site_url: nil,
  shotgun_client_id: nil,
  shotgun_client_secret: nil,
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



17
18
19
# File 'lib/active_shotgun/config.rb', line 17

def initialize
  @config = Struct.new(*DEFAULT_CONFIG.keys).new(*DEFAULT_CONFIG.values)
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



20
21
22
# File 'lib/active_shotgun/config.rb', line 20

def config
  @config
end

Instance Method Details

#configure {|@config| ... } ⇒ Object

Yields:



38
39
40
41
42
# File 'lib/active_shotgun/config.rb', line 38

def configure(&block)
  return unless block

  yield(@config)
end