bigbrother 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,17 @@
1
+ Big Brother
2
+ =======
3
+
4
+ Big Brother allows you to validate routing numbers.
5
+
6
+ ## INSTALL
7
+
8
+ ```
9
+ $ gem install big_brother
10
+ ```
11
+
12
+ ## USAGE
13
+
14
+ ```ruby
15
+ "111222333".routing_number?
16
+ ```
17
+
@@ -0,0 +1,12 @@
1
+ require "csv"
2
+
3
+ require "bigbrother/routing_number"
4
+ require "bigbrother/extensions/string"
5
+
6
+ module BigBrother
7
+ extend self
8
+
9
+ VERSION = "0.0.1"
10
+
11
+ NUMBERS = CSV.read(File.join(File.dirname(__FILE__), "..", "numbers.csv"))
12
+ end
@@ -0,0 +1,15 @@
1
+ module BigBrother
2
+ module Extensions
3
+ module String
4
+ def routing_number?
5
+ BigBrother::RoutingNumber::valid_routing_number?(self)
6
+ end
7
+
8
+ def routing_info
9
+ BigBrother::RoutingNumber::routing_info(self)
10
+ end
11
+ end
12
+ end
13
+ end
14
+
15
+ ::String.__send__(:include, BigBrother::Extensions::String)
@@ -0,0 +1,30 @@
1
+ module BigBrother
2
+ module RoutingNumber
3
+ extend self
4
+
5
+ def valid_routing_number?(number)
6
+ found = BigBrother::NUMBERS.find do |row|
7
+ row[0].strip == number
8
+ end
9
+
10
+ !!found
11
+ end
12
+
13
+ def routing_info(number)
14
+ bank = BigBrother::NUMBERS.find do |row|
15
+ row[0].strip == number
16
+ end
17
+
18
+ return {} unless bank
19
+
20
+ {
21
+ routing_number: number,
22
+ name: bank[2],
23
+ address: bank[3],
24
+ city: bank[4],
25
+ state: bank[5],
26
+ zip: bank[6]
27
+ }
28
+ end
29
+ end
30
+ end
metadata ADDED
@@ -0,0 +1,49 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bigbrother
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Nick Kezhaya
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-11-05 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: This information is usually hard to find. I've included a relatively
15
+ up-to-date CSV that contains all routing numbers and information for each bank.
16
+ email: nick@whitepaperclip.com
17
+ executables: []
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - lib/bigbrother/extensions/string.rb
22
+ - lib/bigbrother/routing_number.rb
23
+ - lib/bigbrother.rb
24
+ - README.md
25
+ homepage: http://github.com/whitepaperclip/BigBrother
26
+ licenses: []
27
+ post_install_message:
28
+ rdoc_options: []
29
+ require_paths:
30
+ - lib
31
+ required_ruby_version: !ruby/object:Gem::Requirement
32
+ none: false
33
+ requirements:
34
+ - - ! '>='
35
+ - !ruby/object:Gem::Version
36
+ version: '0'
37
+ required_rubygems_version: !ruby/object:Gem::Requirement
38
+ none: false
39
+ requirements:
40
+ - - ! '>='
41
+ - !ruby/object:Gem::Version
42
+ version: '0'
43
+ requirements: []
44
+ rubyforge_project:
45
+ rubygems_version: 1.8.24
46
+ signing_key:
47
+ specification_version: 3
48
+ summary: Routing number validation and querying.
49
+ test_files: []