Class: Eztexting::Keywords

Inherits:
Base
  • Object
show all
Defined in:
lib/eztexting/keywords.rb

Class Method Summary collapse

Methods inherited from Base

do_post, process, processed_reponse

Class Method Details

.configureArray

Configure A Keyword param [Hash] This requires only four keys, the keyword your targeting, its group, an autoreply and a url

Returns:

  • (Array)

    The return is an array of two elements, the mapped error code according to the extexting and the raw response



31
32
33
34
35
36
37
38
39
40
41
# File 'lib/eztexting/keywords.rb', line 31

def self.configure
  location = "/keyword/setup"
  options = {
    :keyword => opts[:keyword],
    :group => opts[:group],
    :autoreply => opts[:autoreply],
    :url => opts[:url]
  }
  
  response = self.do_post(location,options)      
end

.rent(opts = {}) ⇒ Array

Rent a keyword

Parameters:

  • This (Hash)

    requires alot of parameters in the hash you pass in. You need to pass in a full address, credit card with all the info and the keyword

Returns:

  • (Array)

    The return is an array of two elements, the mapped error code according to the extexting and the raw response



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/eztexting/keywords.rb', line 7

def self.rent(opts={})
  location = "/keyword/rent/"
  options = {
    :keyword => opts[:keyword],
    :firstname => opts[:first_name],
    :lastname => opts[:last_name],
    :address => opts[:address], 
    :city => opts[:city], 
    :state => opts[:state], 
    :zip => opts[:zip], 
    :country => opts[:country], 
    :type => opts[:cc_type], 
    :ccnumber => opts[:cc_number],
    :cccode => opts[:cc_verification_code], 
    :expm => opts[:cc_expiration_month], 
    :expy => opts[:cc_expiration_year]
  }
  
  response = self.do_post(location,options)
end