Class: CSV_MODULE::MyCSV

Inherits:
Object
  • Object
show all
Defined in:
lib/sentra/rest_client.rb

Instance Method Summary collapse

Constructor Details

#initialize(filename, scheme = nil) ⇒ MyCSV

Returns a new instance of MyCSV.



6
7
8
9
# File 'lib/sentra/rest_client.rb', line 6

def initialize filename, scheme=nil
  @filename = filename
  @scheme = scheme
end

Instance Method Details

#get_queriesObject



11
12
13
14
15
16
17
18
# File 'lib/sentra/rest_client.rb', line 11

def get_queries
  queries = []
  CSV.foreach(@filename, :headers=> true) do |row|
    queries.push(row.to_hash)
    #p row.to_hash
  end
  queries
end