Method: Spider::Model.base_type

Defined in:
lib/spiderfw/model/model.rb

.base_type(klass) ⇒ Class

Returns the base type corresponding to a class.

For BaseModels, the class itself will be returned; otherwise, will walk superclasses and DataType info until one of the base_types is found.

Parameters:

Returns:

  • (Class)

    The Base Type



36
37
38
39
40
41
42
# File 'lib/spiderfw/model/model.rb', line 36

def self.base_type(klass)
    k = klass
    while (k && !base_types.include?(k))
        k = simplify_type(k)
    end
    return k
end