Class: Parser::EventDescription

Inherits:
Object
  • Object
show all
Defined in:
lib/parser/event_description.rb

Instance Method Summary collapse

Constructor Details

#initialize(description) ⇒ EventDescription

Returns a new instance of EventDescription.



5
6
7
# File 'lib/parser/event_description.rb', line 5

def initialize(description)
  @description = description.to_s
end

Instance Method Details

#event_typeObject



13
14
15
16
17
18
19
20
21
22
# File 'lib/parser/event_description.rb', line 13

def event_type
  case @description
  when /Снятие/
    :open
  when /Постановка/
    :close
  else
    :unknown
  end
end

#user_nameObject



9
10
11
# File 'lib/parser/event_description.rb', line 9

def user_name
  Parser.configuration.users[user_key] || 'Unknown User'
end