Class: Linkage::Configuration
- Inherits:
-
Object
- Object
- Linkage::Configuration
- Defined in:
- lib/linkage/configuration.rb
Defined Under Namespace
Classes: DSL
Instance Attribute Summary collapse
-
#dataset_1 ⇒ Object
readonly
Returns the value of attribute dataset_1.
-
#dataset_2 ⇒ Object
readonly
Returns the value of attribute dataset_2.
-
#expectations ⇒ Object
readonly
Returns the value of attribute expectations.
-
#linkage_type ⇒ Object
Returns the value of attribute linkage_type.
-
#results_uri ⇒ Object
Returns the value of attribute results_uri.
-
#results_uri_options ⇒ Object
Returns the value of attribute results_uri_options.
-
#visual_comparisons ⇒ Object
readonly
Returns the value of attribute visual_comparisons.
Instance Method Summary collapse
- #configure(&block) ⇒ Object
- #groups_table_schema ⇒ Object
-
#initialize(dataset_1, dataset_2) ⇒ Configuration
constructor
A new instance of Configuration.
- #result_set ⇒ Object
Constructor Details
#initialize(dataset_1, dataset_2) ⇒ Configuration
Returns a new instance of Configuration.
307 308 309 310 311 312 313 |
# File 'lib/linkage/configuration.rb', line 307 def initialize(dataset_1, dataset_2) @dataset_1 = dataset_1 @dataset_2 = dataset_2 @expectations = [] @visual_comparisons = [] @linkage_type = dataset_1 == dataset_2 ? :self : :dual end |
Instance Attribute Details
#dataset_1 ⇒ Object (readonly)
Returns the value of attribute dataset_1.
304 305 306 |
# File 'lib/linkage/configuration.rb', line 304 def dataset_1 @dataset_1 end |
#dataset_2 ⇒ Object (readonly)
Returns the value of attribute dataset_2.
304 305 306 |
# File 'lib/linkage/configuration.rb', line 304 def dataset_2 @dataset_2 end |
#expectations ⇒ Object (readonly)
Returns the value of attribute expectations.
304 305 306 |
# File 'lib/linkage/configuration.rb', line 304 def expectations @expectations end |
#linkage_type ⇒ Object
Returns the value of attribute linkage_type.
305 306 307 |
# File 'lib/linkage/configuration.rb', line 305 def linkage_type @linkage_type end |
#results_uri ⇒ Object
Returns the value of attribute results_uri.
305 306 307 |
# File 'lib/linkage/configuration.rb', line 305 def results_uri @results_uri end |
#results_uri_options ⇒ Object
Returns the value of attribute results_uri_options.
305 306 307 |
# File 'lib/linkage/configuration.rb', line 305 def @results_uri_options end |
#visual_comparisons ⇒ Object (readonly)
Returns the value of attribute visual_comparisons.
304 305 306 |
# File 'lib/linkage/configuration.rb', line 304 def visual_comparisons @visual_comparisons end |
Instance Method Details
#configure(&block) ⇒ Object
315 316 317 |
# File 'lib/linkage/configuration.rb', line 315 def configure(&block) DSL.new(self, &block) end |
#groups_table_schema ⇒ Object
319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 |
# File 'lib/linkage/configuration.rb', line 319 def groups_table_schema schema = [] # add id schema << [:id, Integer, {:primary_key => true}] # add values @expectations.each do |exp| next if exp.kind == :filter merged_field = exp.merged_field merged_type = merged_field.ruby_type schema << [merged_field.name, merged_type[:type], merged_type[:opts] || {}] end schema end |