class Telegrambot::Types::Base

Public Instance Methods

to_compact_hash() click to toggle source

@return [Hash]

# File lib/telegrambot/types/base.rb, line 6
def to_compact_hash
  Hash[attributes.dup.delete_if { |_, v| v.nil? }.map do |key, value|
        value =
          if value.class.ancestors.include?(Telegrambot::Types::Base)
            value.to_compact_hash
          else
            value
          end
        [key, value]
  end]
end