Class: ActiveRecord::Dbt::Seed::Enum::Yml
- Inherits:
-
Object
- Object
- ActiveRecord::Dbt::Seed::Enum::Yml
- Includes:
- Column::DataTestable::NotNullDataTestable, Column::DataTestable::UniqueDataTestable, DataType::Mapper, Base
- Defined in:
- lib/active_record/dbt/seed/enum/yml.rb
Constant Summary
Constants included from DataType::Mapper
DataType::Mapper::RUBY_TO_DWH_PLATFORM_TYPE_MAP
Instance Attribute Summary collapse
-
#enum_column ⇒ Object
readonly
Returns the value of attribute enum_column.
-
#table ⇒ Object
readonly
Returns the value of attribute table.
Attributes included from Base
#enum_column_name, #table_name
Instance Method Summary collapse
- #dump ⇒ Object
- #export_path ⇒ Object
-
#initialize(table, enum_column) ⇒ Yml
constructor
A new instance of Yml.
Methods included from Validation::TableNameValidator
Methods included from RequiredMethods
Methods included from Column::DataTestable::NotNullDataTestable
Methods included from Column::DataTestable::UniqueDataTestable
Constructor Details
#initialize(table, enum_column) ⇒ Yml
Returns a new instance of Yml.
20 21 22 23 24 |
# File 'lib/active_record/dbt/seed/enum/yml.rb', line 20 def initialize(table, enum_column) @table = table @enum_column = enum_column super(table.table_name, enum_column.column_name) end |
Instance Attribute Details
#enum_column ⇒ Object (readonly)
Returns the value of attribute enum_column.
13 14 15 |
# File 'lib/active_record/dbt/seed/enum/yml.rb', line 13 def enum_column @enum_column end |
#table ⇒ Object (readonly)
Returns the value of attribute table.
13 14 15 |
# File 'lib/active_record/dbt/seed/enum/yml.rb', line 13 def table @table end |
Instance Method Details
#dump ⇒ Object
30 31 32 |
# File 'lib/active_record/dbt/seed/enum/yml.rb', line 30 def dump YAML.dump(properties.deep_stringify_keys) end |
#export_path ⇒ Object
26 27 28 |
# File 'lib/active_record/dbt/seed/enum/yml.rb', line 26 def export_path "#{basename}.yml" end |