Closed vladislav-yashin closed 5 years ago
Hi, @funk-yourself! Just curious, what's a point of inheriting from Telegram::Bot::Types::InlineKeyboardMarkup
?
I needed to override the initializer: https://github.com/centosadmin/redmine_intouch/blob/a51cc5420c3cc93175acee64f44ceba1690aee3f/lib/intouch/preview/keyboard_markup.rb
Also, in general this change is intended to satisfy Liskov substitution principle: "if S is a subtype of T, then objects of type T may be replaced with objects of type S (i.e. an object of type T may be substituted with any object of a subtype S) without altering any of the desirable properties of the program"
Sounds reasonable! Merged!
There was an issue with inheritance: when passing instances of
Telegram::Bot::Types::InlineKeyboardMarkup
(e.g.) descendants, it failed to jsonify objects.