Files

Enumerable

Public Instance Methods

all_kinds() click to toggle source
# File lib/sugar-high/kind_of.rb, line 50
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
only_kinds_of?(*kinds) click to toggle source
# File lib/sugar-high/kind_of.rb, line 21
def only_kinds_of? *kinds    
  all?{|a| a.any_kind_of? *kinds }    
end
only_labels?() click to toggle source
# File lib/sugar-high/kind_of.rb, line 25
def only_labels?
  all?{|a| a.kind_of_label? }    
end
select_kinds_of(*kinds) click to toggle source
# File lib/sugar-high/kind_of.rb, line 29
def select_kinds_of *kinds
  select{|a| a.any_kind_of? *kinds }
end
select_labels() click to toggle source
# File lib/sugar-high/kind_of.rb, line 33
def select_labels
  select{|a| a.kind_of_label? }
end
select_only(type) click to toggle source
# File lib/sugar-high/kind_of.rb, line 45
def select_only type    
  const = type.kind_of_label? ? "#{type.to_s.camelize}".constantize : type
  select{|a| a.kind_of? const}
end
select_strings() click to toggle source
# File lib/sugar-high/kind_of.rb, line 41
def select_strings
  select_only :string
end
select_symbols() click to toggle source
# File lib/sugar-high/kind_of.rb, line 37
def select_symbols
  select{|a| a.kind_of_symbol? }
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.