Sha256: 4dad366c4bd4cc1cfd0fb56007bd45666e3ed919f2bf56983c1fc6877418eda1

Contents?: true

Size: 408 Bytes

Versions: 3

Compression:

Stored size: 408 Bytes

Contents

class Module

  # Removes all but the containing modules from this module's name
  def demodulize
    self.to_s.gsub(/^.*::/, '')
  end

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

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
caricature-0.7.6 lib/caricature/core_ext/module.rb
caricature-0.7.5 lib/caricature/core_ext/module.rb
caricature-0.7.2 lib/core_ext/module.rb