Method: DataDuck::Table#extract!

Defined in:
lib/dataduck/table.rb

#extract!(destination = nil, options = {}) ⇒ Object



116
117
118
119
120
121
122
123
124
125
126
127
128
# File 'lib/dataduck/table.rb', line 116

def extract!(destination = nil, options = {})
  DataDuck::Logs.info "Extracting table #{ self.name }"

  self.errors ||= []
  self.data = []
  self.class.sources.each do |source_spec|
    source = source_spec[:source]
    my_query = self.extract_query(source_spec, destination)
    results = source.query(my_query)
    self.data.concat(results)
  end
  self.data
end