Class: Volute::VoluteArray
- Inherits:
-
Array
- Object
- Array
- Volute::VoluteArray
- Defined in:
- lib/volute.rb
Overview
Instance Method Summary collapse
Instance Method Details
#filter(arg) ⇒ Object
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
# File 'lib/volute.rb', line 139 def filter(arg) select { |args, block| classes = args.select { |a| a.is_a?(Class) } if args.include?(arg) true elsif arg.is_a?(Class) (arg.ancestors & classes).size > 0 elsif arg.is_a?(Module) (arg.constants.collect { |c| arg.const_get(c) } & classes).size > 0 #elsif arg.is_a?(Symbol) # already handled by the initial if else false end } end |