Skip to content

Commit

Permalink
A little clearer name for the option-fixing helper method.
Browse files Browse the repository at this point in the history
It's about the time *range*, and I don't want this to be confused
with the `time_from_options` method
  • Loading branch information
ymendel committed Aug 16, 2010
1 parent 9278457 commit 6599bf4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/punch.rb
Expand Up @@ -195,7 +195,7 @@ def do_out_single(project, options)

def do_list_single(project, options)
return nil unless project_data = data[project]
options = fix_time_options(options)
options = fix_range_options(options)
project_data = project_data.select { |t| t['in'] > options[:after] } if options[:after]
project_data = project_data.select { |t| (t['out'] || Time.now) < options[:before] } if options[:before]
project_data
Expand All @@ -212,7 +212,7 @@ def time_from_options(options)
options[:time] || options[:at] || Time.now
end

def fix_time_options(options)
def fix_range_options(options)
if date = options[:on]
options[:after] = date
options[:before] = date + 1
Expand Down

0 comments on commit 6599bf4

Please sign in to comment.