Module: FCC::Station

Defined in:
lib/fcc/station.rb,
lib/fcc/station/info.rb,
lib/fcc/station/cache.rb,
lib/fcc/station/index.rb,
lib/fcc/station/result.rb,
lib/fcc/station/lms_data.rb,
lib/fcc/station/record_group.rb,
lib/fcc/station/extended_info.rb,
lib/fcc/station/record_delegate.rb,
lib/fcc/station/parsers/lms_data.rb,
lib/fcc/station/parsers/extended_info.rb

Defined Under Namespace

Modules: Parsers Classes: Cache, Community, Contact, ExtendedInfo, Index, Info, LmsData, RecordDelegate, RecordGroup, Result

Class Method Summary collapse

Class Method Details

.extended_info_cacheObject



41
42
43
# File 'lib/fcc/station.rb', line 41

def self.extended_info_cache
  @cache ||= Station::Cache.new
end

.find(service, call_sign, options = {}) ⇒ Object



24
25
26
# File 'lib/fcc/station.rb', line 24

def self.find(service, call_sign, options = {})
  Result.new(service, call_sign, options)
end

.find_each(service, &block) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/fcc/station.rb', line 16

def self.find_each(service, &block)
  results = index(service).results

  results.each do |result|
    yield find(service, result['callSign'])
  end
end

.index(service) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/fcc/station.rb', line 28

def self.index(service)
  case service.to_s.downcase.to_sym
  when :fm
    @fm_index ||= Index.new(:fm)
  when :am
    @am_index ||= Index.new(:am)
  when :tv
    @tv_index ||= Index.new(:tv)
  else
    raise "unsupported service #{service}. :fm, :am, and :tv are valid"
  end
end