Class: Pipio::TimeParser
- Inherits:
-
Object
- Object
- Pipio::TimeParser
- Defined in:
- lib/pipio/time_parser.rb
Constant Summary collapse
- NO_DATE =
/\A\d{1,2}:\d{1,2}:\d{1,2}(?: [AP]M)?\Z/
- UNPARSEABLE_BY_DATETIME_PARSE =
01/22/2008 03:01:45 PM
'%m/%d/%Y %I:%M:%S %P'
Instance Method Summary collapse
-
#initialize(year, month, day) ⇒ TimeParser
constructor
A new instance of TimeParser.
- #parse(timestamp) ⇒ Object
Constructor Details
#initialize(year, month, day) ⇒ TimeParser
Returns a new instance of TimeParser.
8 9 10 |
# File 'lib/pipio/time_parser.rb', line 8 def initialize(year, month, day) @fallback_date_string = "#{year}-#{month}-#{day}" end |
Instance Method Details
#parse(timestamp) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/pipio/time_parser.rb', line 12 def parse() if if has_no_date?() parse_with_date(@fallback_date_string + " " + ) else parse_with_date() end end end |