module MetalArchives

Metal Archives Ruby API

Constants

VERSION

MetalArchives API version

Public Class Methods

config() click to toggle source

API configuration

Instance of MetalArchives::Configuration

# File lib/metal_archives/configuration.rb, line 9
def config
  raise MetalArchives::Errors::InvalidConfigurationError, 'Gem has not been configured' unless @config

  @config
end
configure() { |config| ... } click to toggle source

Configure API options.

A block must be specified, to which a MetalArchives::Configuration parameter will be passed.

Raises
  • InvalidConfigurationException

# File lib/metal_archives/configuration.rb, line 24
def configure
  raise MetalArchives::Errors::InvalidConfigurationError, 'No configuration block given' unless block_given?
  @config = MetalArchives::Configuration.new
  yield @config

  raise MetalArchives::Errors::InvalidConfigurationError, 'app_name has not been configured' unless MetalArchives.config.app_name && !MetalArchives.config.app_name.empty?
  raise MetalArchives::Errors::InvalidConfigurationError, 'app_version has not been configured' unless MetalArchives.config.app_version && !MetalArchives.config.app_version.empty?
  raise MetalArchives::Errors::InvalidConfigurationError, 'app_contact has not been configured' unless MetalArchives.config.app_contact && !MetalArchives.config.app_contact.empty?
end