Class: Parser::Event
- Inherits:
-
Object
- Object
- Parser::Event
- Defined in:
- lib/parser/event.rb
Constant Summary collapse
- DATETIME =
'%s %s +0400'
- PARSE_FORMAT =
'%d/%m/%y %T %Z'
Instance Method Summary collapse
- #datetime ⇒ Object
- #description ⇒ Object
- #event_type ⇒ Object
-
#initialize(date, time, description) ⇒ Event
constructor
A new instance of Event.
- #unusual? ⇒ Boolean
- #user_name ⇒ Object
Constructor Details
#initialize(date, time, description) ⇒ Event
Returns a new instance of Event.
8 9 10 |
# File 'lib/parser/event.rb', line 8 def initialize(date, time, description) @date, @time, @description = date, time, description end |
Instance Method Details
#datetime ⇒ Object
12 13 14 |
# File 'lib/parser/event.rb', line 12 def datetime @datetime ||= DateTime.strptime(DATETIME % [@date, @time], PARSE_FORMAT) end |
#description ⇒ Object
16 17 18 |
# File 'lib/parser/event.rb', line 16 def description @description end |
#event_type ⇒ Object
24 25 26 |
# File 'lib/parser/event.rb', line 24 def event_type parsed_description.event_type end |
#unusual? ⇒ Boolean
28 29 30 |
# File 'lib/parser/event.rb', line 28 def unusual? Checker.unusual?(datetime) end |
#user_name ⇒ Object
20 21 22 |
# File 'lib/parser/event.rb', line 20 def user_name parsed_description.user_name end |