Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.2.0.1 hacks and fixes #10

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ rvm:
- 2.0.0
- 2.1.0
- 2.2.3
- 2.3.3
- 2.4.1
before_install:
- cp ./spec/config.yml.example ./spec/config.yml
script: bundle exec rspec
22 changes: 11 additions & 11 deletions lib/address_validator/address.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ def from_xml(attrs = {})

attr_accessor :name, :street1, :street2, :street3, :city, :state, :zip, :zip_extended, :country, :classification

def initialize(name: nil, street1: nil, street2: nil, street3: nil, city: nil, state: nil, zip: nil, zip_extended: nil, country: nil, classification: nil)
@name = name
@street1 = street1
@street2 = street2
@street3 = street3
@city = city
@state = state
@zip = zip
@zip_extended = zip_extended
@country = country
@classification = (classification || CLASSIFICATION_UNKNOWN).to_i
def initialize(params)
@name = params[:name]
@street1 = params[:street1]
@street2 = params[:street2]
@street3 = params[:street3]
@city = params[:city]
@state = params[:state]
@zip = params[:zip]
@zip_extended = params[:zip_extended]
@country = params[:country]
@classification = (params[:classification] || CLASSIFICATION_UNKNOWN).to_i
end

def residential?
Expand Down
2 changes: 2 additions & 0 deletions lib/address_validator/response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ def addresses
else
addresses = [ AddressValidator::Address.from_xml(response['AddressKeyFormat']) ]
end
rescue
[]
end

def address
Expand Down