Class: DataImport::Dsl::Import::From
- Inherits:
-
Object
- Object
- DataImport::Dsl::Import::From
- Defined in:
- lib/data-import/dsl/import/from.rb
Instance Attribute Summary collapse
-
#definition ⇒ Object
readonly
Returns the value of attribute definition.
Instance Method Summary collapse
- #columns(*args) ⇒ Object
-
#initialize(definition) ⇒ From
constructor
A new instance of From.
- #order(*args) ⇒ Object
- #primary_key(name) ⇒ Object
- #table(name) ⇒ Object
Constructor Details
#initialize(definition) ⇒ From
Returns a new instance of From.
8 9 10 |
# File 'lib/data-import/dsl/import/from.rb', line 8 def initialize(definition) @definition = definition end |
Instance Attribute Details
#definition ⇒ Object (readonly)
Returns the value of attribute definition.
6 7 8 |
# File 'lib/data-import/dsl/import/from.rb', line 6 def definition @definition end |
Instance Method Details
#columns(*args) ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/data-import/dsl/import/from.rb', line 20 def columns(*args) if args.last.is_a? Hash = args.pop definition.source_distinct_columns = [:distinct] end definition.source_columns |= args end |
#order(*args) ⇒ Object
28 29 30 |
# File 'lib/data-import/dsl/import/from.rb', line 28 def order(*args) definition.source_order_columns |= args end |
#primary_key(name) ⇒ Object
16 17 18 |
# File 'lib/data-import/dsl/import/from.rb', line 16 def primary_key(name) definition.source_primary_key = name end |
#table(name) ⇒ Object
12 13 14 |
# File 'lib/data-import/dsl/import/from.rb', line 12 def table(name) definition.source_table_name = name end |