Class: TelegramMeetupBot::Commands::Base
- Inherits:
-
Object
- Object
- TelegramMeetupBot::Commands::Base
- Defined in:
- lib/telegram_meetup_bot/commands/base.rb
Direct Known Subclasses
CalCommand, CancelCommand, DateCommand, HelpCommand, ListCommand, NilUsername, UserCommand
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
- #command ⇒ Object
- #exec ⇒ Object
-
#initialize(message) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(message) ⇒ Base
Returns a new instance of Base.
6 7 8 |
# File 'lib/telegram_meetup_bot/commands/base.rb', line 6 def initialize() = end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
4 5 6 |
# File 'lib/telegram_meetup_bot/commands/base.rb', line 4 def end |
Instance Method Details
#command ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/telegram_meetup_bot/commands/base.rb', line 14 def command @command ||= if COMMANDS.include?(.command) .command else DEFAULT_COMMAND end end |
#exec ⇒ Object
10 11 12 |
# File 'lib/telegram_meetup_bot/commands/base.rb', line 10 def exec fail NotImplementedError, 'This method should be overriden' end |