Module: TelegramBotApi::Requests::Base::InstanceMethods
- Defined in:
- lib/telegram_bot_api/requests/base.rb
Instance Method Summary collapse
-
#endpoint_url ⇒ Object
For convenience.
- #errors ⇒ Object
- #to_json ⇒ Object
- #valid? ⇒ Boolean
- #verb ⇒ Object
Instance Method Details
#endpoint_url ⇒ Object
For convenience
31 32 33 |
# File 'lib/telegram_bot_api/requests/base.rb', line 31 def endpoint_url self.class.endpoint_url end |
#errors ⇒ Object
23 24 25 26 27 |
# File 'lib/telegram_bot_api/requests/base.rb', line 23 def errors self.class.mandatory_arguments.select do |argument| self.public_send(argument).nil? end end |
#to_json ⇒ Object
13 14 15 16 17 |
# File 'lib/telegram_bot_api/requests/base.rb', line 13 def to_json self.class.all_arguments.inject({}) do |memo, argument| memo.merge!({ argument => self.public_send(argument) }) end end |
#valid? ⇒ Boolean
19 20 21 |
# File 'lib/telegram_bot_api/requests/base.rb', line 19 def valid? errors.empty? end |
#verb ⇒ Object
35 36 37 |
# File 'lib/telegram_bot_api/requests/base.rb', line 35 def verb self.class.verb end |