Class: ActiveRecord::Dbt::Column::Yml
- Inherits:
-
Object
- Object
- ActiveRecord::Dbt::Column::Yml
- Includes:
- DataType::Mapper, I18nWrapper::Translate
- Defined in:
- lib/active_record/dbt/column/yml.rb
Constant Summary
Constants included from DataType::Mapper
DataType::Mapper::RUBY_TO_DWH_PLATFORM_TYPE_MAP
Instance Attribute Summary collapse
-
#column ⇒ Object
readonly
Returns the value of attribute column.
-
#column_data_test ⇒ Object
readonly
Returns the value of attribute column_data_test.
-
#primary_keys ⇒ Object
readonly
Returns the value of attribute primary_keys.
-
#table_name ⇒ Object
readonly
Returns the value of attribute table_name.
Instance Method Summary collapse
-
#initialize(table_name, column, column_data_test, primary_keys: []) ⇒ Yml
constructor
A new instance of Yml.
- #properties ⇒ Object
Methods included from I18nWrapper::Translate
#translated_attribute_name, #translated_table_name
Methods included from RequiredMethods
Constructor Details
#initialize(table_name, column, column_data_test, primary_keys: []) ⇒ Yml
Returns a new instance of Yml.
15 16 17 18 19 20 21 |
# File 'lib/active_record/dbt/column/yml.rb', line 15 def initialize(table_name, column, column_data_test, primary_keys: []) @table_name = table_name @column = column @column_data_test = column_data_test @primary_keys = primary_keys @config = ActiveRecord::Dbt::Config.instance end |
Instance Attribute Details
#column ⇒ Object (readonly)
Returns the value of attribute column.
10 11 12 |
# File 'lib/active_record/dbt/column/yml.rb', line 10 def column @column end |
#column_data_test ⇒ Object (readonly)
Returns the value of attribute column_data_test.
10 11 12 |
# File 'lib/active_record/dbt/column/yml.rb', line 10 def column_data_test @column_data_test end |
#primary_keys ⇒ Object (readonly)
Returns the value of attribute primary_keys.
10 11 12 |
# File 'lib/active_record/dbt/column/yml.rb', line 10 def primary_keys @primary_keys end |
#table_name ⇒ Object (readonly)
Returns the value of attribute table_name.
10 11 12 |
# File 'lib/active_record/dbt/column/yml.rb', line 10 def table_name @table_name end |
Instance Method Details
#properties ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/active_record/dbt/column/yml.rb', line 23 def properties { 'name' => column_name, 'description' => description, 'data_type' => data_type(column.type), **column_overrides.except(:data_tests), 'data_tests' => column_data_test.properties }.compact end |