Created
May 18, 2015 12:50
-
-
Save olistik/326094ff6703a9df31a8 to your computer and use it in GitHub Desktop.
This file contains 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
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