161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
|
# File 'lib/fcc/station/result.rb', line 161
def method_missing(m, *_args)
service = if @service == :fm
fm_record = grouped_records.find { |gr| FCC::FM_FULL_SERVICE == gr.band.upcase }
fm_low_power = grouped_records.find { |gr| FCC::FM_LOW_POWER == gr.band.upcase }
fm_booster = grouped_records.find { |gr| FCC::FM_BOOSTER == gr.band.upcase }
fm_translator = grouped_records.find { |gr| FCC::FM_TRANSLATOR == gr.band.upcase }
[fm_record, fm_low_power, fm_booster, fm_translator].compact.find { |r| r.send(m.to_sym) }
else
grouped_records.find { |r| r.send(m.to_sym) }
end
result = service.send(m.to_sym) if service
result = result.first if result.is_a?(Array) && result.size == 1
result
end
|