Module: EurekaBot::Tg::Controller::RepliesConcern

Extended by:
ActiveSupport::Concern
Included in:
EurekaBot::Tg::Controller
Defined in:
lib/eureka_bot/tg/controller/concerns/replies_concern.rb

Defined Under Namespace

Classes: ClassicMarkup, InlineMarkup, Markup

Instance Method Summary collapse

Instance Method Details

#global_reply_markupObject



17
18
19
20
21
22
23
# File 'lib/eureka_bot/tg/controller/concerns/replies_concern.rb', line 17

def global_reply_markup
  reply_markup resize_keyboard: true, one_time_keyboard: false do
    [
      ['Get Tasks', 'Account', 'Help']
    ]
  end
end

#reply_markup(type: :classic, **options, &block) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/eureka_bot/tg/controller/concerns/replies_concern.rb', line 4

def reply_markup(type: :classic, **options, &block)
  markup = case type
             when :inline
               InlineMarkup.new(self, options)
             when :classic
               ClassicMarkup.new(self, options)
             else
               raise
           end
  markup.run(&block)
  markup
end