renamed extract method to parse and updated specs

This commit is contained in:
Adam Meehan
2008-07-22 08:34:14 +10:00
parent e8bba051c9
commit 89f12b3a25
2 changed files with 11 additions and 11 deletions

View File

@@ -70,8 +70,8 @@ module ValidatesTimeliness
]
@@date_formats = [
'yyyy/mm/dd',
'yyyy-mm-dd',
'yyyy/mm/dd',
'yyyy.mm.dd',
'm/d/yy',
'd/m/yy',
@@ -205,8 +205,8 @@ module ValidatesTimeliness
# Loop through format expressions for type and call proc on matches. Allow
# pre or post match strings to exist if strict is false. Otherwise wrap
# regexp in start and end anchors.
# Returns 7 part datetime array.
def extract_date_time_values(time_string, type, strict=true)
# Returns 7 part time array.
def parse(time_string, type, strict=true)
expressions = self.send("#{type}_expressions")
time_array = nil
expressions.each do |(regexp, processor)|