Sha256: f972371cd96580044718e50af659bf0ad9bf608b87b7a13236d8b714b5fdc281

Contents?: true

Size: 374 Bytes

Versions: 2

Compression:

Stored size: 374 Bytes

Contents

class USPSFlags::Burgees::Builtins
  def self.available
    Dir.glob("lib/usps_flags/burgees/builtins/**/*.svg").map { |b|
      b.split("/").last.split(".svg").first
    }.map(&:to_sym)
  end

  def self.get(burgee)
    raise USPSFlags::Errors::UnknownBurgee unless self.available.include?(burgee)
    ::File.read("lib/usps_flags/burgees/builtins/#{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/builtins.rb
usps_flags-burgees-0.0.2 lib/usps_flags/burgees/builtins.rb