Sha256: 7871d6e3b4df3def8f368d921e467b70fea131437264c61c37cde30cf0fffdf1
Contents?: true
Size: 510 Bytes
Versions: 13
Compression:
Stored size: 510 Bytes
Contents
# Helper class for handling built-in burgees. # # @private class USPSFlags::Burgees::Builtins @@builtins_dir = "#{File.expand_path(File.dirname(__FILE__))}/builtins" def self.available Dir.glob("#{@@builtins_dir}/**/*.svg").map { |b| b.split("/").last.split(".svg").first }.map(&:to_sym) end def self.get(burgee) raise USPSFlags::Errors::UnknownBurgee "Looked in #{@@builtins_dir}" unless self.available.include?(burgee) ::File.read("#{@@builtins_dir}/#{burgee}.svg") end end
Version data entries
13 entries across 13 versions & 1 rubygems