Module: Shaf::Generator::Migration::Types
- Defined in:
- lib/shaf/generator/migration/types.rb
Class Method Summary collapse
Class Method Details
.add(name, **kwargs) ⇒ Object
8 9 10 11 12 |
# 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 ⇒ Object
19 20 21 |
# File 'lib/shaf/generator/migration/types.rb', line 19 def all types.values end |
.find(str) ⇒ Object
14 15 16 17 |
# File 'lib/shaf/generator/migration/types.rb', line 14 def find(str) name, _ = str.to_s.split(',', 2) types[name.to_sym] end |