Class: TelegramMeetupBot::MessageParser
- Inherits:
-
Object
- Object
- TelegramMeetupBot::MessageParser
- Defined in:
- lib/telegram_meetup_bot/message_parser.rb
Defined Under Namespace
Classes: User
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
- #author ⇒ Object
- #command ⇒ Object
-
#initialize(message) ⇒ MessageParser
constructor
A new instance of MessageParser.
- #params ⇒ Object
Constructor Details
#initialize(message) ⇒ MessageParser
Returns a new instance of MessageParser.
6 7 8 |
# File 'lib/telegram_meetup_bot/message_parser.rb', line 6 def initialize() = end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
3 4 5 |
# File 'lib/telegram_meetup_bot/message_parser.rb', line 3 def end |
Instance Method Details
#author ⇒ Object
10 11 12 13 |
# File 'lib/telegram_meetup_bot/message_parser.rb', line 10 def from = .from User.new(from.id, from.username, from.first_name) end |
#command ⇒ Object
15 16 17 18 19 20 |
# File 'lib/telegram_meetup_bot/message_parser.rb', line 15 def command do |words| cmd, bot_name = words.first.split('@') cmd if bot_name.nil? || bot_name == Initializers::ConfigLoader.bot_name end end |
#params ⇒ Object
22 23 24 |
# File 'lib/telegram_meetup_bot/message_parser.rb', line 22 def params { |words| words.drop(1) } || [] end |