Skip to content

Commit

Permalink
expand on comments to create an instance in the future
Browse files Browse the repository at this point in the history
  • Loading branch information
ndushay committed Dec 15, 2015
1 parent da60538 commit 1e25fd6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/stanford-mods/date_parsing.rb
Expand Up @@ -6,6 +6,8 @@ module Mods
# - we may want an integer or date sort field as well as lexical
# - we may want to either make this a module (a collection of methods another class can use)
# or have an initialize method so we don't have to keep passing the date_str argument
# (e.g. we could have my_date.bc? and my_date.sortable_year_for_dddd, esp for any method
# with 'for' rather than 'from_date_str')
class DateParsing

# get single facet value for date, generally an explicit year or "17th century" or "5 B.C."
Expand Down Expand Up @@ -57,6 +59,10 @@ def self.sortable_year_string_from_date_str(date_str)
result
end

# TODO: particularly for the methods below (xxx_for_zzz), we should probably
# have an instance in play, rather than class methods. This would allow the methods
# above to avoid passing date_str in over and over.

# looks for 4 consecutive digits in String and returns first occurence if found
# @param [String] date_str String containing four digit year (we hope)
# @return [String, nil] 4 digit year (e.g. 1865, 0950) if date_str has yyyy, nil otherwise
Expand Down

0 comments on commit 1e25fd6

Please sign in to comment.