Module: SGC::Helper

Defined in:
lib/helpers/flags.rb,
lib/helpers/klass.rb,
lib/helpers/struct.rb,
lib/helpers/interface/ienum.rb

Defined Under Namespace

Modules: FlagsValue, IEnum, Struct

Class Method Summary collapse

Class Method Details

.classname(klass) ⇒ String

Returns The class name of the class without module string.

Examples:

Obtain the class name of the class.

module A
    module B
        class C
        end
    end
end
classname(A::B::C)    #=> "C"

Parameters:

  • klass (Class)

    The name of the class to obtain.

Returns:

  • (String)

    The class name of the class without module string.



39
40
41
# File 'lib/helpers/klass.rb', line 39

def classname(klass)
    klass.name.gsub(/.*\:\:/, "")
end