Module: TmdbRexx::Configuration

Included in:
TmdbRexx
Defined in:
lib/tmdb_rexx/configuration.rb

Constant Summary collapse

VALID_OPTION_KEYS =
[:api_key, :base_url, :version, :include_adult, :language].freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.keysObject


8
9
10
# File 'lib/tmdb_rexx/configuration.rb', line 8

def keys
  @keys ||= VALID_OPTION_KEYS
end

Instance Method Details

#configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:


13
14
15
# File 'lib/tmdb_rexx/configuration.rb', line 13

def configure
  yield self
end

#reset!Object

Reset configuration options to default values


18
19
20
21
22
23
24
25
26
# File 'lib/tmdb_rexx/configuration.rb', line 18

def reset!
  TmdbRexx::Configuration.keys.each do |key|
    instance_variable_set(
      :"@#{key}",
      TmdbRexx::Default.const_get(key.upcase)
    )
  end
  self
end

#respond_to?(method, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)

28
29
30
# File 'lib/tmdb_rexx/configuration.rb', line 28

def respond_to?(method, include_private=false)
  new.respond_to?(method, include_private) || super(method, include_private)
end