ruby_psigate 0.7.6 → 0.7.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG CHANGED
@@ -1,3 +1,4 @@
1
+ v0.7.7. address can now be instantiated with a hash options
1
2
  v0.7.6. gateway handles connection problems gracefully
2
3
  v0.7.5. fixed bug: serializer works for ItemInfo
3
4
  v0.7.4. fixed bug: account charges can now be registered
@@ -21,6 +21,21 @@ module RubyPsigate
21
21
 
22
22
  alias_method :phone, :telephone
23
23
 
24
+ def initialize(options={})
25
+ @firstname = options[:firstname]
26
+ @lastname = options[:lastname]
27
+ @line1 = options[:line1]
28
+ @line2 = options[:line2]
29
+ @city = options[:city]
30
+ @state = options[:state]
31
+ @country = options[:country]
32
+ @zipcode = options[:zipcode]
33
+ @telephone = options[:telephone]
34
+ @fax = options[:fax]
35
+ @company = options[:company]
36
+ super
37
+ end
38
+
24
39
  def name
25
40
  "#{firstname} #{lastname}".strip
26
41
  end
data/ruby_psigate.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{ruby_psigate}
5
- s.version = "0.7.6"
5
+ s.version = "0.7.7"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Simon Chiu"]
@@ -7,6 +7,27 @@ module RubyPsigate
7
7
  @address = Address.new
8
8
  end
9
9
 
10
+ should "instantiate the address with hash" do
11
+ @valid_attributes = {
12
+ :firstname => "Bob",
13
+ :lastname => "Parsons",
14
+ :line1 => "1234 West 3rd Street",
15
+ :line2 => "Apt 123",
16
+ :city => "Toronto",
17
+ :state => "Ontario",
18
+ :country => "Canada",
19
+ :zipcode => "N3N3N3",
20
+ :telephone => "4161234567",
21
+ :fax => "4169999999",
22
+ :company => "Bob Parsons Company"
23
+ }
24
+ @address = Address.new(@valid_attributes)
25
+
26
+ %w( firstname lastname line1 line2 city state province country zipcode postalcode telephone fax company ).each do |field|
27
+ assert_not_nil @address.send(field.to_sym)
28
+ end
29
+ end
30
+
10
31
  %w( firstname lastname line1 line2 city state province country zipcode postalcode telephone fax company ).each do |field|
11
32
  should "respond to #{field}" do
12
33
  assert @address.respond_to?(field.downcase.to_sym)
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 7
8
- - 6
9
- version: 0.7.6
8
+ - 7
9
+ version: 0.7.7
10
10
  platform: ruby
11
11
  authors:
12
12
  - Simon Chiu