Skip to content

Commit

Permalink
rely on implicit self for scanners
Browse files Browse the repository at this point in the history
  • Loading branch information
Lee Jarvis committed Jun 2, 2011
1 parent b83e01c commit 7b84e02
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion lib/chronic/grabber.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Chronic
class Grabber < Tag #:nodoc:
def self.scan(tokens, options)
tokens.each_index do |i|
if t = self.scan_for_all(tokens[i]) then tokens[i].tag(t); next end
if t = scan_for_all(tokens[i]) then tokens[i].tag(t); next end
end
end

Expand Down
4 changes: 2 additions & 2 deletions lib/chronic/ordinal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ class Ordinal < Tag #:nodoc:
def self.scan(tokens, options)
# for each token
tokens.each_index do |i|
if t = self.scan_for_ordinals(tokens[i]) then tokens[i].tag(t) end
if t = self.scan_for_days(tokens[i]) then tokens[i].tag(t) end
if t = scan_for_ordinals(tokens[i]) then tokens[i].tag(t) end
if t = scan_for_days(tokens[i]) then tokens[i].tag(t) end
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/chronic/pointer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Pointer < Tag #:nodoc:
def self.scan(tokens, options)
# for each token
tokens.each_index do |i|
if t = self.scan_for_all(tokens[i]) then tokens[i].tag(t) end
if t = scan_for_all(tokens[i]) then tokens[i].tag(t) end
end
end

Expand Down
12 changes: 6 additions & 6 deletions lib/chronic/repeater.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ class Repeater < Tag #:nodoc:
def self.scan(tokens, options)
# for each token
tokens.each_index do |i|
if t = self.scan_for_season_names(tokens[i]) then tokens[i].tag(t); next end
if t = self.scan_for_month_names(tokens[i]) then tokens[i].tag(t); next end
if t = self.scan_for_day_names(tokens[i]) then tokens[i].tag(t); next end
if t = self.scan_for_day_portions(tokens[i]) then tokens[i].tag(t); next end
if t = self.scan_for_times(tokens[i]) then tokens[i].tag(t); next end
if t = self.scan_for_units(tokens[i]) then tokens[i].tag(t); next end
if t = scan_for_season_names(tokens[i]) then tokens[i].tag(t); next end
if t = scan_for_month_names(tokens[i]) then tokens[i].tag(t); next end
if t = scan_for_day_names(tokens[i]) then tokens[i].tag(t); next end
if t = scan_for_day_portions(tokens[i]) then tokens[i].tag(t); next end
if t = scan_for_times(tokens[i]) then tokens[i].tag(t); next end
if t = scan_for_units(tokens[i]) then tokens[i].tag(t); next end
end
end

Expand Down
8 changes: 4 additions & 4 deletions lib/chronic/scalar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ class Scalar < Tag #:nodoc:
def self.scan(tokens, options)
# for each token
tokens.each_index do |i|
if t = self.scan_for_scalars(tokens[i], tokens[i + 1]) then tokens[i].tag(t) end
if t = self.scan_for_days(tokens[i], tokens[i + 1]) then tokens[i].tag(t) end
if t = self.scan_for_months(tokens[i], tokens[i + 1]) then tokens[i].tag(t) end
if t = self.scan_for_years(tokens[i], tokens[i + 1], options) then tokens[i].tag(t) end
if t = scan_for_scalars(tokens[i], tokens[i + 1]) then tokens[i].tag(t) end
if t = scan_for_days(tokens[i], tokens[i + 1]) then tokens[i].tag(t) end
if t = scan_for_months(tokens[i], tokens[i + 1]) then tokens[i].tag(t) end
if t = scan_for_years(tokens[i], tokens[i + 1], options) then tokens[i].tag(t) end
end
end

Expand Down
10 changes: 5 additions & 5 deletions lib/chronic/separator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ module Chronic
class Separator < Tag #:nodoc:
def self.scan(tokens, options)
tokens.each_index do |i|
if t = self.scan_for_commas(tokens[i]) then tokens[i].tag(t); next end
if t = self.scan_for_slash_or_dash(tokens[i]) then tokens[i].tag(t); next end
if t = self.scan_for_at(tokens[i]) then tokens[i].tag(t); next end
if t = self.scan_for_in(tokens[i]) then tokens[i].tag(t); next end
if t = self.scan_for_on(tokens[i]) then tokens[i].tag(t); next end
if t = scan_for_commas(tokens[i]) then tokens[i].tag(t); next end
if t = scan_for_slash_or_dash(tokens[i]) then tokens[i].tag(t); next end
if t = scan_for_at(tokens[i]) then tokens[i].tag(t); next end
if t = scan_for_in(tokens[i]) then tokens[i].tag(t); next end
if t = scan_for_on(tokens[i]) then tokens[i].tag(t); next end
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/chronic/time_zone.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Chronic
class TimeZone < Tag #:nodoc:
def self.scan(tokens, options)
tokens.each_index do |i|
if t = self.scan_for_all(tokens[i]) then tokens[i].tag(t); next end
if t = scan_for_all(tokens[i]) then tokens[i].tag(t); next end
end
end

Expand Down

0 comments on commit 7b84e02

Please sign in to comment.