Class: Class

Inherits:
Object show all
Defined in:
lib/core_ext/class.rb

Instance Method Summary collapse

Instance Method Details

#clr_type?Boolean

indicates whether this type has a CLR type in its ancestors

Returns:

  • (Boolean)


9
10
11
12
13
# File 'lib/core_ext/class.rb', line 9

def 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

#demodulizeObject

removes all the modules from this class name



4
5
6
# File 'lib/core_ext/class.rb', line 4

def demodulize
  self.to_s.gsub(/^.*::/, '')
end