module BbcRadioNetworks

Access to BBC Radio network names and information

Version number for the current BbcRadioNetworks module

Constants

ALL_NETWORKS
LOCALS
NATIONALS
NATIONS
NETWORK_TYPES
VERSION

Public Class Methods

get_network_id(network_name) click to toggle source

Looks up a network ID by network name

# File lib/bbc_radio_networks.rb, line 256
def self.get_network_id(network_name)
  ALL_NETWORKS[network_name][:bbc_id]
end
get_network_key(network_name) click to toggle source

Looks up a network key by network name

# File lib/bbc_radio_networks.rb, line 251
def self.get_network_key(network_name)
  ALL_NETWORKS[network_name][:bbc_key]
end
list_networks() click to toggle source

Returns an array of all networks’ user friendly names

# File lib/bbc_radio_networks.rb, line 261
def self.list_networks
  ALL_NETWORKS.keys
end
random_network_name(type = 'all_networks') click to toggle source

Returns a random network name

# File lib/bbc_radio_networks.rb, line 266
def self.random_network_name(type = 'all_networks')
  if type == 'all_networks'
    network_type = NETWORK_TYPES.keys.sample
    NETWORK_TYPES[network_type].keys.sample
  else
    NETWORK_TYPES[type].keys.sample
  end
end