Module Kwalify::Types
In: kwalify/types.rb

Methods

Constants

DEFAULT_TYPE = "str"

Public Class methods

[Source]

# File kwalify/types.rb, line 119
      def self.get_type_class(type)
         return type_class(type)
      end

[Source]

# File kwalify/types.rb, line 113
      def self.type_class(type)
         klass = @@type_table[type]
         #assert_error('type=#{type.inspect}') unless klass
         return klass
      end

[Source]

# File kwalify/types.rb, line 109
      def self.type_table
         return @@type_table
      end

Public Instance methods

[Source]

# File kwalify/types.rb, line 134
      def collection?(val)
         return val.is_a?(Array) || val.is_a?(Hash)
      end

[Source]

# File kwalify/types.rb, line 142
      def collection_type?(type)
         return type == 'seq' || type == 'map'
      end

[Source]

# File kwalify/types.rb, line 138
      def scalar?(val)
         return !val.is_a?(Array) && !val.is_a?(Hash) && val.class != Object
      end

[Source]

# File kwalify/types.rb, line 146
      def scalar_type?(type)
         return type != 'seq' && type != 'map' && type == 'any'
      end

[Validate]