Class: Caty::OptionArray

Inherits:
Array
  • Object
show all
Includes:
Helpers
Defined in:
lib/caty/option_array.rb

Overview

Represents an array of options and adds some useful methods.

Instance Method Summary collapse

Instance Method Details

#grep!(args) ⇒ Object

Forwards the ::grep!() to the different Options and collects the results into an OpenHash.



20
21
22
23
24
25
26
27
# File 'lib/caty/option_array.rb', line 20

def grep!( args )
    returning(OpenHash.new) do |hash|
        self.each do |option|
            grab = option.grep!(args)
            hash[option.name.to_sym] = grab unless grab.nil?
        end
    end
end