Sha256: 1546a90e2755fd770a2888bb21fbb73da85e3831adb51729dfbd2c5817cde0ba

Contents?: true

Size: 422 Bytes

Versions: 9

Compression:

Stored size: 422 Bytes

Contents

class Class

  # removes all the modules from this class name
  def demodulize
    self.to_s.gsub(/^.*::/, '')
  end

  # indicates whether this type has a CLR type in its ancestors
  def is_clr_type?
    !self.to_clr_type.nil? ||
            self.included_modules.any? {|mod| !mod.to_clr_type.nil? } ||
            self.ancestors.reject {|mod| mod == Object }.any? { |mod| !mod.to_clr_type.nil? }
  end

end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
casualjim-caricature-0.5.0 lib/core_ext/class.rb
casualjim-caricature-0.6.0 lib/core_ext/class.rb
casualjim-caricature-0.6.1 lib/core_ext/class.rb
caricature-0.7.1 lib/core_ext/class.rb
caricature-0.7.0 lib/core_ext/class.rb
caricature-0.6.3 lib/core_ext/class.rb
caricature-0.5.0 lib/core_ext/class.rb
caricature-0.6.0 lib/core_ext/class.rb
caricature-0.6.1 lib/core_ext/class.rb