Class: DateMolder::Parser
- Inherits:
-
Object
- Object
- DateMolder::Parser
- Defined in:
- lib/date_molder/parser.rb
Instance Attribute Summary collapse
-
#formats ⇒ Object
Returns the value of attribute formats.
-
#init ⇒ Object
Returns the value of attribute init.
-
#parsed_time ⇒ Object
Returns the value of attribute parsed_time.
-
#solutions ⇒ Object
Returns the value of attribute solutions.
Instance Method Summary collapse
-
#initialize(str, formats) ⇒ Parser
constructor
A new instance of Parser.
- #parse ⇒ Object
Constructor Details
#initialize(str, formats) ⇒ Parser
Returns a new instance of Parser.
5 6 7 8 9 10 11 |
# File 'lib/date_molder/parser.rb', line 5 def initialize(str, formats) @str = str @init = str.dup @formats = formats @solutions= [] @parsed_time = Time.parse(str) end |
Instance Attribute Details
#formats ⇒ Object
Returns the value of attribute formats.
3 4 5 |
# File 'lib/date_molder/parser.rb', line 3 def formats @formats end |
#init ⇒ Object
Returns the value of attribute init.
3 4 5 |
# File 'lib/date_molder/parser.rb', line 3 def init @init end |
#parsed_time ⇒ Object
Returns the value of attribute parsed_time.
3 4 5 |
# File 'lib/date_molder/parser.rb', line 3 def parsed_time @parsed_time end |
#solutions ⇒ Object
Returns the value of attribute solutions.
3 4 5 |
# File 'lib/date_molder/parser.rb', line 3 def solutions @solutions end |
Instance Method Details
#parse ⇒ Object
13 14 15 |
# File 'lib/date_molder/parser.rb', line 13 def parse parse_internal(@str, 0) end |