eligible 2.5.0 → 2.6.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 +4 -4
- data/.codeclimate.yml +29 -0
- data/.rspec +1 -0
- data/.rubocop.yml +1156 -2
- data/ChangeLog +8 -0
- data/README.md +1 -1
- data/Rakefile +6 -0
- data/lib/eligible.rb +35 -22
- data/lib/eligible/api_resource.rb +10 -0
- data/lib/eligible/claim.rb +13 -10
- data/lib/eligible/coverage.rb +8 -12
- data/lib/eligible/coverage_resource.rb +19 -0
- data/lib/eligible/customer.rb +19 -0
- data/lib/eligible/demographic.rb +5 -7
- data/lib/eligible/eligible_object.rb +1 -2
- data/lib/eligible/enrollment.rb +7 -6
- data/lib/eligible/medicare.rb +5 -7
- data/lib/eligible/original_signature_pdf.rb +29 -0
- data/lib/eligible/payer.rb +16 -0
- data/lib/eligible/payment.rb +1 -2
- data/lib/eligible/ticket.rb +7 -13
- data/lib/eligible/util.rb +14 -10
- data/lib/eligible/version.rb +1 -1
- data/lib/eligible/x12.rb +2 -2
- metadata +8 -3
data/lib/eligible/util.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
module Eligible
|
2
2
|
module Util
|
3
|
-
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
4
3
|
def self.convert_to_eligible_object(resp, api_key)
|
5
4
|
case resp
|
6
5
|
when Array
|
@@ -10,7 +9,7 @@ module Eligible
|
|
10
9
|
resp.map { |i| convert_to_eligible_object(i, api_key) }
|
11
10
|
end
|
12
11
|
when Hash
|
13
|
-
if resp[:
|
12
|
+
if resp[:enrollment_npi]
|
14
13
|
klass = Enrollment
|
15
14
|
elsif resp[:demographics]
|
16
15
|
klass = Coverage
|
@@ -24,16 +23,21 @@ module Eligible
|
|
24
23
|
end
|
25
24
|
end
|
26
25
|
|
27
|
-
#
|
26
|
+
# Converts a key into a symbol if it is possible, returns the key if it is not
|
27
|
+
def self.symbolize_name(key)
|
28
|
+
return key unless key.respond_to?(:to_sym)
|
29
|
+
return key.to_sym
|
30
|
+
end
|
31
|
+
|
28
32
|
def self.symbolize_names(object)
|
29
33
|
case object
|
30
34
|
when Hash
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
+
{}.tap do |new_hash|
|
36
|
+
object.each do |key, value|
|
37
|
+
key = symbolize_name(key)
|
38
|
+
new_hash[key] = symbolize_names(value)
|
39
|
+
end
|
35
40
|
end
|
36
|
-
new
|
37
41
|
when Array
|
38
42
|
object.map { |value| symbolize_names(value) }
|
39
43
|
else
|
@@ -62,13 +66,13 @@ module Eligible
|
|
62
66
|
|
63
67
|
def self.flatten_params_array(value, calculated_key)
|
64
68
|
result = []
|
65
|
-
value.
|
69
|
+
value.each_with_index do |elem, index|
|
66
70
|
if elem.is_a?(Hash)
|
67
71
|
result += flatten_params(elem, calculated_key)
|
68
72
|
elsif elem.is_a?(Array)
|
69
73
|
result += flatten_params_array(elem, calculated_key)
|
70
74
|
else
|
71
|
-
result << ["#{calculated_key}[]", elem]
|
75
|
+
result << ["#{calculated_key}[#{index}]", elem]
|
72
76
|
end
|
73
77
|
end
|
74
78
|
result
|
data/lib/eligible/version.rb
CHANGED
data/lib/eligible/x12.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
module Eligible
|
2
2
|
class X12 < APIResource
|
3
3
|
def self.post(params, api_key = nil)
|
4
|
-
|
5
|
-
|
4
|
+
params[:format] = 'x12'
|
5
|
+
send_request(:post, '/x12', api_key, params)
|
6
6
|
end
|
7
7
|
end
|
8
8
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eligible
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Katelyn Gleaon
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-02-
|
13
|
+
date: 2016-02-24 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rest-client
|
@@ -106,6 +106,7 @@ executables: []
|
|
106
106
|
extensions: []
|
107
107
|
extra_rdoc_files: []
|
108
108
|
files:
|
109
|
+
- ".codeclimate.yml"
|
109
110
|
- ".gitignore"
|
110
111
|
- ".rspec"
|
111
112
|
- ".rubocop.yml"
|
@@ -119,6 +120,8 @@ files:
|
|
119
120
|
- lib/eligible/api_resource.rb
|
120
121
|
- lib/eligible/claim.rb
|
121
122
|
- lib/eligible/coverage.rb
|
123
|
+
- lib/eligible/coverage_resource.rb
|
124
|
+
- lib/eligible/customer.rb
|
122
125
|
- lib/eligible/demographic.rb
|
123
126
|
- lib/eligible/eligible_object.rb
|
124
127
|
- lib/eligible/enrollment.rb
|
@@ -129,6 +132,8 @@ files:
|
|
129
132
|
- lib/eligible/errors/invalid_request_error.rb
|
130
133
|
- lib/eligible/json.rb
|
131
134
|
- lib/eligible/medicare.rb
|
135
|
+
- lib/eligible/original_signature_pdf.rb
|
136
|
+
- lib/eligible/payer.rb
|
132
137
|
- lib/eligible/payment.rb
|
133
138
|
- lib/eligible/ticket.rb
|
134
139
|
- lib/eligible/util.rb
|
@@ -154,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
159
|
version: '0'
|
155
160
|
requirements: []
|
156
161
|
rubyforge_project:
|
157
|
-
rubygems_version: 2.4.
|
162
|
+
rubygems_version: 2.4.5.1
|
158
163
|
signing_key:
|
159
164
|
specification_version: 4
|
160
165
|
summary: Ruby wrapper for the Eligible API
|