Skip to content

Instantly share code, notes, and snippets.

Created April 19, 2011 00:11
Show Gist options
  • Save anonymous/926564 to your computer and use it in GitHub Desktop.
Save anonymous/926564 to your computer and use it in GitHub Desktop.
require "rubygems"
require "fastercsv"
class SalAttend
attr_accessor :file
attr_accessor :headers
def initialize
puts "JSAttend Initialized"
end
def open_file(filename)
puts "Trying to open the file with FasterCSV"
@file = FasterCSV.open(filename, {:headers => true, :return_headers => true, :header_converters => :symbol})
@headers = @file.readline
end
def print_names
@file.each do |line|
puts line[:first_name] + " " + line[:last_name]
end
end
end
jsa = SalAttend.new
jsa.print_names
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment