Class: Signupto::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/signupto/base.rb

Class Method Summary collapse

Class Method Details

.balance(options = {}) ⇒ Object

retrives your account balance and returns it as a string



6
7
8
9
10
11
# File 'lib/signupto/base.rb', line 6

def balance(options = {})
  if options.has_key?(:account_hash) and options.has_key?(:customer_number)
     = Account.new(options[:account_hash], options[:customer_number])
    return Action::Balance.new().to_s
  end
end

.send!(options = {}) ⇒ Object

Upon a sucsesfull send this will return the message number for tracking purposese on the signupto systems.



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/signupto/base.rb', line 15

def send!(options = {})
  if options.has_key?(:account_hash) and options.has_key?(:customer_number)
     = Account.new(options[:account_hash], options[:customer_number])
    if options.has_key?(:message) and options.has_key?(:to)
      message = Message.new(options[:to], options[:message], options[:from])
      puts message.to
      return Action::Sender.new(, message)
    else
      raise ArgumentError, "You must supply a message to send and a place to send it"
    end
  end
end