Created
April 19, 2011 00:11
-
-
Save anonymous/926564 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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