gatorjuice_credit_rating 0.1.0
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.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.rspec +2 -0
- data/.travis.yml +3 -0
- data/Gemfile +5 -0
- data/README.md +38 -0
- data/Rakefile +1 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/gatorjuice_credit_rating.gemspec +33 -0
- data/lib/gatorjuice_credit_rating/version.rb +3 -0
- data/lib/gatorjuice_credit_rating.rb +28 -0
- metadata +110 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: b9e19852baae6906dac522a362bbfddcf6ca19bd
|
4
|
+
data.tar.gz: c67f9d722ad6d4940149d49a0db3e3ad9c5b1d2e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 798fb332cd52c165e3ef580d155c706ab9b06f72480c5f00ecb40a14af24a29e0f2ccd7a9694e62ed8161ea8f376cba5a4752d7fb9b47284557305480bae653f
|
7
|
+
data.tar.gz: 90f336fb0345178cdb6db82975b02abadc7c65fa782fcf4d0bc64831ebcd4147fefedf4a2c5e83931cba856954ab617025197ad07f1398904a9735db4c654190
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
# GatorjuiceCreditRating
|
2
|
+
|
3
|
+
Finally! A tool for entering three pieces of information and getting arbitrary data back in order to make incredibly important decisions
|
4
|
+
|
5
|
+
|
6
|
+
## Installation
|
7
|
+
|
8
|
+
Add this line to your application's Gemfile:
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
gem 'gatorjuice_credit_rating'
|
12
|
+
```
|
13
|
+
|
14
|
+
And then execute:
|
15
|
+
|
16
|
+
$ bundle
|
17
|
+
|
18
|
+
Or install it yourself as:
|
19
|
+
|
20
|
+
$ gem install gatorjuice_credit_rating
|
21
|
+
|
22
|
+
## Usage
|
23
|
+
```ruby
|
24
|
+
inquiry = GatorjuiceCreditRating::Assessment.inquiry(age: 40, income: 25000, zipcode: 60626)
|
25
|
+
|
26
|
+
inquiry.propensity => 0.23445
|
27
|
+
|
28
|
+
inquiry.ranking => "B"
|
29
|
+
```
|
30
|
+
## Development
|
31
|
+
|
32
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
|
33
|
+
|
34
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
35
|
+
|
36
|
+
## Running Unit Tests
|
37
|
+
|
38
|
+
after cloning this repo, cd into the gem's folder and run 'bundle exec rspec'
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "gatorjuice_credit_rating"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'gatorjuice_credit_rating/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "gatorjuice_credit_rating"
|
8
|
+
spec.version = GatorjuiceCreditRating::VERSION
|
9
|
+
spec.authors = ["Jamie"]
|
10
|
+
spec.email = ["gatorjuice@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{fake credit ranking}
|
13
|
+
spec.description = %q{gives a fake credit ranking.}
|
14
|
+
spec.homepage = "https://github.com/gatorjuice/gatorjuice_credit_rating"
|
15
|
+
|
16
|
+
# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
|
17
|
+
# delete this section to allow pushing this gem to any host.
|
18
|
+
# if spec.respond_to?(:metadata)
|
19
|
+
# spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
|
20
|
+
# else
|
21
|
+
# raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
|
22
|
+
# end
|
23
|
+
|
24
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
25
|
+
spec.bindir = "exe"
|
26
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
27
|
+
spec.require_paths = ["lib"]
|
28
|
+
|
29
|
+
spec.add_development_dependency "bundler", "~> 1.9"
|
30
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
31
|
+
spec.add_development_dependency "rspec", "3.4.0"
|
32
|
+
spec.add_dependency "unirest", "1.1.2"
|
33
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require "gatorjuice_credit_rating/version"
|
2
|
+
require "unirest"
|
3
|
+
|
4
|
+
module GatorjuiceCreditRating
|
5
|
+
class Assessment
|
6
|
+
attr_reader :propensity, :ranking
|
7
|
+
|
8
|
+
def initialize(input_hash)
|
9
|
+
@propensity = input_hash["propensity"].to_f
|
10
|
+
@ranking = input_hash["ranking"]
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.inquiry(input_options)
|
14
|
+
if input_options[:age] && input_options[:income] && input_options[:zipcode]
|
15
|
+
response = Unirest.get("http://jsonplaceholder.typicode.com/users?income=#{input_options[:income]}&age=#{input_options[:age]}&zipcode=#{input_options[:zipcode]}").body
|
16
|
+
# assuming this was the actual endpoint, I'd get this response back
|
17
|
+
response = {
|
18
|
+
"propensity" => rand.round(5),
|
19
|
+
"ranking" => %w(A B C D E F).sample
|
20
|
+
}
|
21
|
+
assessment = Assessment.new(response)
|
22
|
+
return assessment
|
23
|
+
else
|
24
|
+
return "invalid inquiry"
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
metadata
ADDED
@@ -0,0 +1,110 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: gatorjuice_credit_rating
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jamie
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-03-30 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.9'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.9'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 3.4.0
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 3.4.0
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: unirest
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.1.2
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 1.1.2
|
69
|
+
description: gives a fake credit ranking.
|
70
|
+
email:
|
71
|
+
- gatorjuice@gmail.com
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- ".gitignore"
|
77
|
+
- ".rspec"
|
78
|
+
- ".travis.yml"
|
79
|
+
- Gemfile
|
80
|
+
- README.md
|
81
|
+
- Rakefile
|
82
|
+
- bin/console
|
83
|
+
- bin/setup
|
84
|
+
- gatorjuice_credit_rating.gemspec
|
85
|
+
- lib/gatorjuice_credit_rating.rb
|
86
|
+
- lib/gatorjuice_credit_rating/version.rb
|
87
|
+
homepage: https://github.com/gatorjuice/gatorjuice_credit_rating
|
88
|
+
licenses: []
|
89
|
+
metadata: {}
|
90
|
+
post_install_message:
|
91
|
+
rdoc_options: []
|
92
|
+
require_paths:
|
93
|
+
- lib
|
94
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
95
|
+
requirements:
|
96
|
+
- - ">="
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '0'
|
99
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
requirements: []
|
105
|
+
rubyforge_project:
|
106
|
+
rubygems_version: 2.4.6
|
107
|
+
signing_key:
|
108
|
+
specification_version: 4
|
109
|
+
summary: fake credit ranking
|
110
|
+
test_files: []
|