Class: Fontist::FormulaPicker
- Inherits:
-
Object
- Object
- Fontist::FormulaPicker
- Defined in:
- lib/fontist/formula_picker.rb
Instance Method Summary collapse
- #call(formulas) ⇒ Object
-
#initialize(font_name, size_limit:, version:, smallest:, newest:) ⇒ FormulaPicker
constructor
A new instance of FormulaPicker.
Constructor Details
permalink #initialize(font_name, size_limit:, version:, smallest:, newest:) ⇒ FormulaPicker
Returns a new instance of FormulaPicker.
5 6 7 8 9 10 11 12 13 |
# File 'lib/fontist/formula_picker.rb', line 5 def initialize(font_name, size_limit:, version:, smallest:, newest:) @font_name = font_name @size_limit = size_limit || Fontist.formula_size_limit_in_megabytes @options = {} @version = @options[:version] = version if version @smallest = @options[:smallest] = smallest if smallest @newest = @options[:newest] = newest if newest end |
Instance Method Details
permalink #call(formulas) ⇒ Object
[View source]
15 16 17 18 19 20 21 22 |
# File 'lib/fontist/formula_picker.rb', line 15 def call(formulas) return [] if formulas.empty? list = filter(formulas) return [] if list.empty? choose(list) end |