Sha256: c03dc4dd810bda518b990aa8861943ef1fbe2c15cfdd543207daa1b332fc66ca
Contents?: true
Size: 680 Bytes
Versions: 12
Compression:
Stored size: 680 Bytes
Contents
require "active_support/inflector" require "sugar-high/enumerable" class Object def kinda_file? any_kind_of?(File, Dir) end def any_kind_of? *kinds kinds.all_kinds.each do |kind| return true if self.kind_of? kind end false end def not_any_kind_of? *kinds kinds.all_kinds.each do |kind| return false if self.kind_of? kind end true end def kind_of_label? self.any_kind_of? String, Symbol end def kind_of_number? self.any_kind_of? Numeric end def kind_of_symbol? self.any_kind_of? Symbols, Symbol end end class Kinds attr_accessor :kinds def initialize *kinds self.kinds = *kinds end end
Version data entries
12 entries across 12 versions & 1 rubygems