module Shaf::Generator::Migration::Types

Public Class Methods

add(name, **kwargs) click to toggle source
# File lib/shaf/generator/migration/types.rb, line 8
def add(name, **kwargs)
  Type.new(name, **kwargs).tap do |type|
    types[type.name] = type
  end
end
all() click to toggle source
# File lib/shaf/generator/migration/types.rb, line 19
def all
  types.values
end
find(str) click to toggle source
# File lib/shaf/generator/migration/types.rb, line 14
def find(str)
  name, _ = str.to_s.split(',', 2)
  types[name.to_sym]
end

Private Class Methods

clear() click to toggle source
# File lib/shaf/generator/migration/types.rb, line 29
def clear
  @types.clear if defined? @types
end
types() click to toggle source
# File lib/shaf/generator/migration/types.rb, line 25
def types
  @types ||= {}
end