Sha256: 7b24c4f7e59751a88765ac53a3a860c994ce0d3336d9cacf06e54d090893b6b4

Contents?: true

Size: 465 Bytes

Versions: 2

Compression:

Stored size: 465 Bytes

Contents

require 'telegram_bot/params/shared/user_component'

module Telegram
  module Params
    class From < UserComponent
      def initialize(params)
        message = params.require(:message)
        @params = message[:from]
        # If from exist then return nil 
        return nil if @params.blank?
          
        from_params = message.require(:from)
        super(from_params)
      end

      def nil?
        super || @params.nil?
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tg-bot-0.0.2 lib/telegram_bot/params/from.rb
tg-bot-0.0.1 lib/telegram_bot/params/from.rb