Created
July 9, 2021 09:41
-
-
Save lumentut/9a02a0b7680884018f82b02947de52fc to your computer and use it in GitHub Desktop.
Data types principle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DataTypes | |
def col(name, args) | |
puts name | |
puts args | |
end | |
end | |
class Test | |
def column_defs(&block) | |
yield DataTypes.new | |
end | |
end | |
test = Test.new | |
test.column_defs do |q| | |
q.col :satu ,type: :string, length: 10 | |
q.col :dua ,type: :integer, length: 5 | |
q.col :tiga ,type: :boolean, default: true | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment