Module: Kortype

Defined in:
lib/kortype.rb,
lib/kortype/type.rb,
lib/kortype/parse.rb,
lib/kortype/version.rb,
lib/kortype/type_error.rb

Overview

require ‘active_support/concern’ require ‘active_support/hash_with_indifferent_access’

Defined Under Namespace

Modules: ClassMethods Classes: Parse, Type, TypeError

Constant Summary collapse

VERSION =
"0.1.0"

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object

extend ActiveSupport::Concern



11
12
13
# File 'lib/kortype.rb', line 11

def Kortype.included(base)
  base.extend Kortype::ClassMethods
end

Instance Method Details

#kortype_columnsObject



15
16
17
18
19
20
21
22
23
# File 'lib/kortype.rb', line 15

def kortype_columns
  @kortype_columns ||= begin
                         cols = {}
                         self.class.kortype_columns.each do |key, value|
                           cols[key] = Kortype::Type.new value.name, value.type, value.options
                         end
                         cols
                       end
end