Sha256: 1ec057ba2580e8123a6467a12a64b72aba3f4741ad1d0bfc9ec059c013b3d961

Contents?: true

Size: 1.17 KB

Versions: 6

Compression:

Stored size: 1.17 KB

Contents

require 'msgpack'
require 'msgpack/rpc'

module MelissaData::Client

  class Base
    attr_reader :rpc

    def self.available?
      raise 'I should have been subclassed'
    end

    def initialize(*args)
      raise 'I should have been subclassed'
    end

    def process(opts={})
      rpc.call :process, opts
    end

    def process_address(address=nil, zip=nil, city=nil, state=nil)
      rpc.call :process_address, address, zip, city, state
    end
    alias_method :address, :process_address

    def process_email(email=nil)
      rpc.call :process_email, email
    end
    alias_method :email, :process_email

    def process_geo(zip=nil, plus4=nil, dpc=nil)
      rpc.call :process_geo, zip, plus4, dpc
    end
    alias_method :geo, :process_geo

    def process_name(first_name=nil, last_name=nil)
      rpc.call :process_name, first_name, last_name
    end
    alias_method :name, :process_name

    def process_phone(phone=nil, zip=nil)
      rpc.call :process_phone, phone, zip
    end
    alias_method :phone, :process_phone

    def process_ip(ip)
      rpc.call :process_ip, ip
    end
    alias_method :ip, :process_ip

    def version
      rpc.call :version
    end
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
melissadata-0.1.5 lib/melissadata/client/base.rb
melissadata-0.1.4 lib/melissadata/client/base.rb
melissadata-0.1.3 lib/melissadata/client/base.rb
melissadata-0.1.2 lib/melissadata/client/base.rb
melissadata-0.1.1 lib/melissadata/client/base.rb
melissadata-0.1.0 lib/melissadata/client/base.rb