Class: Sign::Fetcher
- Inherits:
-
Object
- Object
- Sign::Fetcher
- Defined in:
- lib/sign/fetcher.rb
Constant Summary collapse
- @@list =
{}
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.get_list ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/sign/fetcher.rb', line 13 def self.get_list format = "%-16s %10s" @@list.each do |name, info| puts format % [name, info] end end |
Instance Method Details
#get_license(license) ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/sign/fetcher.rb', line 21 def get_license(license) if @@list.has_key?(license.downcase) file_name = "#{license}.txt" File.open("#{license_path}/#{file_name}") else raise ArgumentError, "#{license} is not available." end end |
#license_path ⇒ Object
30 31 32 |
# File 'lib/sign/fetcher.rb', line 30 def license_path File.("../../vendor/licenses", __dir__) end |