Sha256: 609fea6e936f013b2a39ea88b21422ef3eba8e64d89e99d0e7f9cdf4aa08d758

Contents?: true

Size: 762 Bytes

Versions: 18

Compression:

Stored size: 762 Bytes

Contents

require File.expand_path('../common_request', __FILE__)
module Gateway
  module Requests
    #
    # Request to change settings for whatsapp account via gateway
    #
    class SetProfileRequest < CommonRequest

      TYPE_NICKNAME = 1 # nickname
      TYPE_AVATAR   = 2 # path to avatar
      TYPE_STATUS   = 3 # status

      attr_accessor :type, :devicePhone, :value

      #
      # Possible types
      #
      def self.possible_types
        [TYPE_NICKNAME, TYPE_AVATAR, TYPE_STATUS]
      end

      def type=(type)
        unless self.class.possible_types.include? type
          raise Gateway::ArgumentError.new("type #{type} is not supported, use: #{self.class.possible_types.join(', ')}")
        end
        @type = type
      end

    end
  end

end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
gateway-sdk-1.2.5 lib/gateway/requests/set_profile_request.rb
gateway-sdk-1.2.4 lib/gateway/requests/set_profile_request.rb
gateway-sdk-1.2.3 lib/gateway/requests/set_profile_request.rb
gateway-sdk-1.1.3 lib/gateway/requests/set_profile_request.rb
gateway-sdk-1.1.2 lib/gateway/requests/set_profile_request.rb
gateway-sdk-1.1.1 lib/gateway/requests/set_profile_request.rb
gateway-sdk-1.1.0 lib/gateway/requests/set_profile_request.rb
gateway-sdk-1.0.4 lib/gateway/requests/set_profile_request.rb
gateway-sdk-1.0.3 lib/gateway/requests/set_profile_request.rb
gateway-sdk-1.0.2 lib/gateway/requests/set_profile_request.rb
gateway-sdk-1.0.1 lib/gateway/requests/set_profile_request.rb
gateway-sdk-1.0.0 lib/gateway/requests/set_profile_request.rb
gateway-sdk-0.2.4 lib/gateway/requests/set_profile_request.rb
gateway-sdk-0.2.3 lib/gateway/requests/set_profile_request.rb
gateway-sdk-0.2.2 lib/gateway/requests/set_profile_request.rb
gateway-sdk-0.2.1 lib/gateway/requests/set_profile_request.rb
gateway-sdk-0.2.0 lib/gateway/requests/set_profile_request.rb
gateway_sdk-0.2.0 lib/gateway/requests/set_profile_request.rb