Skip to content

Instantly share code, notes, and snippets.

@olistik
Created May 18, 2015 12:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save olistik/326094ff6703a9df31a8 to your computer and use it in GitHub Desktop.
Save olistik/326094ff6703a9df31a8 to your computer and use it in GitHub Desktop.
class Line
attr_reader :line
def initialize(text)
@line = text
end
def office
values[2].strip
end
def employee_id
values[1].strip
end
def last_name
name = values[0]
name.split[0]
end
private
def values
@values ||= lines.split(',')
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment