Sha256: eb1dbc2e35fc786b197dfc268a41b63196a0a1209c4a84d5ee1ed1386c3a3c41

Contents?: true

Size: 485 Bytes

Versions: 4

Compression:

Stored size: 485 Bytes

Contents

module ShackKit
  module Data
    class SOTACalls
      def self.update(source_file = SOURCES_DIR + "/masterSOTA.scp")
        calls = DB[:sota_calls]
        calls.delete
        File.foreach(source_file) do |line|
          callsign = line.strip
          calls.insert(callsign: callsign) if callsign =~ CALLSIGN_REGEX
        end
        calls.count
      end

      def self.include?(callsign)
        DB[:sota_calls].where(callsign: callsign).count > 0
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
shack_kit-0.2.2 lib/shack_kit/data/sota_calls.rb
shack_kit-0.2.1 lib/shack_kit/data/sota_calls.rb
shack_kit-0.2.0 lib/shack_kit/data/sota_calls.rb
shack_kit-0.1.2 lib/shack_kit/data/sota_calls.rb