Sha256: 5e4aa3dc1b7333b0d6756d3e78838f5adae26027460f784380f098729759eb29

Contents?: true

Size: 369 Bytes

Versions: 2

Compression:

Stored size: 369 Bytes

Contents

class USPSFlags::Burgees::Customs
  def self.available
    Dir.glob("#{USPSFlags::Config.burgees_dir}/**/*.svg").map do |b|
      b.split("/").last.split(".svg").first.to_sym
    end
  end

  def self.get(burgee)
    raise USPSFlags::Errors::UnknownBurgee unless self.available.include?(burgee)
    ::File.read("lib/usps_flags/burgees/customs/#{burgee}.svg")
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
usps_flags-burgees-0.0.3 lib/usps_flags/burgees/customs.rb
usps_flags-burgees-0.0.2 lib/usps_flags/burgees/customs.rb