Class: Halftime::Parser
- Inherits:
-
Object
- Object
- Halftime::Parser
- Defined in:
- lib/halftime/parser.rb
Instance Method Summary collapse
-
#initialize(string, now:) ⇒ Parser
constructor
A new instance of Parser.
- #time ⇒ Object
Constructor Details
#initialize(string, now:) ⇒ Parser
Returns a new instance of Parser.
7 8 9 10 11 12 |
# File 'lib/halftime/parser.rb', line 7 def initialize(string, now:) @string = string @now = now @parser = InternalParser.new @transform = Transform.new end |
Instance Method Details
#time ⇒ Object
14 15 16 17 18 |
# File 'lib/halftime/parser.rb', line 14 def time time_factory.time(now) rescue Parslet::ParseFailed nil end |