Class: GatewaySupport
Overview
Constant Summary
collapse
- ACTIONS =
[:purchase, :authorize, :capture, :void, :credit, :recurring]
AbtainBilling::Billing::AuthorizedNetGateway
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
Returns a new instance of GatewaySupport.
Instance Attribute Details
#gateways ⇒ Object
Returns the value of attribute gateways.
11
12
13
|
# File 'lib/support/gateway_support.rb', line 11
def gateways
@gateways
end
|
Instance Method Details
#each_gateway ⇒ Object
18
19
20
|
# File 'lib/support/gateway_support.rb', line 18
def each_gateway
@gateways.each{|g| yield g }
end
|
#features ⇒ Object
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/support/gateway_support.rb', line 22
def features
width = 15
print "Name".center(width + 20)
ACTIONS.each{|f| print "#{f.to_s.capitalize.center(width)}" }
puts
each_gateway do |g|
print "#{g.display_name.ljust(width + 20)}"
ACTIONS.each do |f|
print "#{(g.instance_methods.include?(f.to_s) ? "Y" : "N").center(width)}"
end
puts
end
end
|
#to_rdoc ⇒ Object
38
39
40
41
42
|
# File 'lib/support/gateway_support.rb', line 38
def to_rdoc
each_gateway do |g|
puts "* {#{g.display_name}}[#{g.homepage_url}] - #{g.supported_countries.join(', ')}"
end
end
|
#to_s ⇒ Object
50
51
52
53
54
|
# File 'lib/support/gateway_support.rb', line 50
def to_s
each_gateway do |g|
puts "#{g.display_name} - #{g.homepage_url} [#{g.supported_countries.join(', ')}]"
end
end
|
#to_textile ⇒ Object
44
45
46
47
48
|
# File 'lib/support/gateway_support.rb', line 44
def to_textile
each_gateway do |g|
puts %/ * "#{g.display_name}":#{g.homepage_url} [#{g.supported_countries.join(', ')}]/
end
end
|