Class: Imgproxy::OptionsCasters::Group
- Inherits:
-
Object
- Object
- Imgproxy::OptionsCasters::Group
- Defined in:
- lib/imgproxy/options_casters/group.rb
Overview
Casts group of options and trim nils from the end
Instance Method Summary collapse
- #cast(raw) ⇒ Object
-
#initialize(extractors) ⇒ Group
constructor
A new instance of Group.
Constructor Details
#initialize(extractors) ⇒ Group
Returns a new instance of Group.
11 12 13 |
# File 'lib/imgproxy/options_casters/group.rb', line 11 def initialize(extractors) @extractors = extractors end |
Instance Method Details
#cast(raw) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/imgproxy/options_casters/group.rb', line 15 def cast(raw) values = @extractors.map do |key, extractor| extractor.cast(raw[key]) end values.trim! end |