Class: Telegram::Bot::Types::ReplyKeyboardMarkup
- Inherits:
-
Object
- Object
- Telegram::Bot::Types::ReplyKeyboardMarkup
- Defined in:
- lib/telegram/bot/types/reply_keyboard_markup.rb
Instance Attribute Summary collapse
-
#keyboard ⇒ Object
Returns the value of attribute keyboard.
-
#one_time_keyboard ⇒ Object
Returns the value of attribute one_time_keyboard.
-
#resize_keyboard ⇒ Object
Returns the value of attribute resize_keyboard.
-
#selective ⇒ Object
Returns the value of attribute selective.
Instance Method Summary collapse
-
#initialize(attributes, options = {}) ⇒ ReplyKeyboardMarkup
constructor
A new instance of ReplyKeyboardMarkup.
Constructor Details
#initialize(attributes, options = {}) ⇒ ReplyKeyboardMarkup
Returns a new instance of ReplyKeyboardMarkup.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/telegram/bot/types/reply_keyboard_markup.rb', line 5 def initialize(attributes, = {}) .each { |k, v| self.send("#{k}=", v) if self.respond_to? k } @keyboard = attributes.map do |v| v.map do |b| if b.is_a?(KeyboardButton) b elsif b.is_a?(Hash) InlineKeyboardButton.new(b) else raise Telegram::Bot::KeyboardMarkupError .new('Attributes must be Array of Array of Telegram::Bot::Types::KeyboardButton or Hash') end end end end |
Instance Attribute Details
#keyboard ⇒ Object
Returns the value of attribute keyboard.
3 4 5 |
# File 'lib/telegram/bot/types/reply_keyboard_markup.rb', line 3 def keyboard @keyboard end |
#one_time_keyboard ⇒ Object
Returns the value of attribute one_time_keyboard.
3 4 5 |
# File 'lib/telegram/bot/types/reply_keyboard_markup.rb', line 3 def one_time_keyboard @one_time_keyboard end |
#resize_keyboard ⇒ Object
Returns the value of attribute resize_keyboard.
3 4 5 |
# File 'lib/telegram/bot/types/reply_keyboard_markup.rb', line 3 def resize_keyboard @resize_keyboard end |
#selective ⇒ Object
Returns the value of attribute selective.
3 4 5 |
# File 'lib/telegram/bot/types/reply_keyboard_markup.rb', line 3 def selective @selective end |