class Parser::EventDescription
Public Class Methods
new(description)
click to toggle source
# File lib/parser/event_description.rb, line 5 def initialize(description) @description = description.to_s end
Public Instance Methods
event_type()
click to toggle source
# File lib/parser/event_description.rb, line 13 def event_type case @description when /Снятие/ :open when /Постановка/ :close else :unknown end end
user_name()
click to toggle source
# File lib/parser/event_description.rb, line 9 def user_name Parser.configuration.users[user_key] || 'Unknown User' end
Private Instance Methods
user_key()
click to toggle source
# File lib/parser/event_description.rb, line 26 def user_key if match = @description.match(/\d+/) match[0].to_i end end