Skip to content

Commit

Permalink
Clean
Browse files Browse the repository at this point in the history
  • Loading branch information
dessy committed Oct 27, 2014
1 parent 73ec129 commit 953d05f
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions pedometer/models/upload.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ class Upload

def initialize(file_path)
@file_path = file_path
@user_params = file_name.first.split('-')
@trial_params = file_name.last.split('-')
end

# -- Class Methods --------------------------------------------------------
Expand Down Expand Up @@ -46,20 +48,10 @@ def self.all
file_paths.map { |file_path| self.new(file_path) }
end

# -- Instance Methods -----------------------------------------------------

def user_params
file_name.first.split('-')
end

def trial_params
file_name.last.split('-')
end

private

def file_name
@file_name ||= file_path.split('/').last.split('.txt').first.split('_')
@file_name ||= @file_path.split('/').last.split('.txt').first.split('_')
end

end

0 comments on commit 953d05f

Please sign in to comment.