Class: Txter::Gateway

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

Direct Known Subclasses

Gateway4info, GatewayTwilio

Defined Under Namespace

Classes: Request, Response

Constant Summary collapse

Success =
Txter::Gateway::Response.new(:status => :success)
Error =
Txter::Gateway::Response.new(:status => :error)

Class Method Summary collapse

Class Method Details

.currentObject



28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/gateway.rb', line 28

def self.current
  case Txter.configuration.gateway
  when 'twilio'
    gem 'twiliolib'
    require 'twiliolib'
    GatewayTwilio
  when '4info'
    Gateway4info
  when 'test'
    Txter::Gateway
  else
    raise "You need to specify your Txter gateway!"
  end
end

.deliver(*args) ⇒ Object



18
19
20
21
# File 'lib/gateway.rb', line 18

def self.deliver(*args)
  # subclasses should actually do something here
  Success 
end

.unblock(*args) ⇒ Object



23
24
25
26
# File 'lib/gateway.rb', line 23

def self.unblock(*args)
  # subclasses should actually do something here
  Success 
end