# File lib/sugar-high/enumerable.rb, line 75 def all_kinds map do |a| case a when Kinds a.kinds else a if a.kind_of?(Module) end end.compact.uniq.flatten end
# File lib/sugar-high/enumerable.rb, line 2 def only_kinds_of? *kinds all?{|a| a.any_kind_of? *kinds } end
# File lib/sugar-high/enumerable.rb, line 6 def only_labels? all?{|a| a.kind_of_label? } end
# File lib/sugar-high/enumerable.rb, line 10 def only_numbers? all?{|a| a.kind_of_number? } end
# File lib/sugar-high/enumerable.rb, line 14 def select_kinds_of *kinds select{|a| a.any_kind_of? *kinds } end
# File lib/sugar-high/enumerable.rb, line 18 def select_kinds_of! *kinds select!{|a| a.any_kind_of? *kinds } self end
# File lib/sugar-high/enumerable.rb, line 23 def select_labels select{|a| a.kind_of_label? } end
# File lib/sugar-high/enumerable.rb, line 36 def select_labels! select!{|a| a.kind_of_label? } self end
# File lib/sugar-high/enumerable.rb, line 27 def select_numbers select{|a| a.is_a?(Numeric) } end
# File lib/sugar-high/enumerable.rb, line 31 def select_numbers! select!{|a| a.is_a?(Numeric) } self end
# File lib/sugar-high/enumerable.rb, line 64 def select_only type const = type.kind_of_label? ? "#{type.to_s.camelize}".constantize : type select{|a| a.kind_of? const} end
# File lib/sugar-high/enumerable.rb, line 69 def select_only! type const = type.kind_of_label? ? "#{type.to_s.camelize}".constantize : type select!{|a| a.kind_of? const} self end
# File lib/sugar-high/enumerable.rb, line 55 def select_strings select_only :string end
# File lib/sugar-high/enumerable.rb, line 59 def select_strings! select_only! :string self end
# File lib/sugar-high/enumerable.rb, line 41 def select_symbols select_only :symbol end
Generated with the Darkfish Rdoc Generator 2.