change_health 1.0.0 → 1.0.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e3aefe8f92bcd2320ffd7cf26a436144b7a76b5e90d6d3f56377b37d0278a705
4
- data.tar.gz: 25d4efc4c61e6356408d9df77fb9daecc93aadd10d687c0fcce530f51ea3fe30
3
+ metadata.gz: 6c0475b9e925fd6ff896bb48a1d512f41085b35576b91b426b5ef83d567a428b
4
+ data.tar.gz: 42b48761b66ae58e8c72ec42b99082a20ccdda1f8554068a0981cebd35bd35d1
5
5
  SHA512:
6
- metadata.gz: 892a5e89e6204506c34eeb696ef52717441e3a15e9cc0c64461af2ec9fe5203ff884a8ff9919ebff0c4a4d13330d7ecbb9600d727514ab53a1f066f7f55204d6
7
- data.tar.gz: 2b05c1ba8a94cf1d9a299476b8faf673ae3ab8f41337913159a068e724e3bbf37db57803e1e674b7fb065dc6fc7169f2d8abf2f72ef5348b4a7dffe7ad354b6a
6
+ metadata.gz: b7e2365fa92c0847c9363e518ff52631da5a17501b16d9f93b233edaea374491450d6cd3d9d5b8d91fb78b8dc3c326ab9dd05a1531ea765ad6c54769f2c58fdd
7
+ data.tar.gz: fec74c0bc9f129ec49632de92d147776d455643b190de8e750a4b5b5a6732b74ef164bdbd788d93345df0688e631f926d30506abc9c46ab0c50323a55ea42146
data/CHANGELOG.md CHANGED
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
6
 
7
+
8
+ ## [1.0.1] - [2021-03-24]
9
+ ### Added
10
+ - EligibilityData#plan_status - adds ability to select instead of find
11
+ - EligibilityData#inactive? active? - use new plan_status select
12
+
7
13
  ## [1.0.0] - [2021-03-17]
8
14
  ### Added
9
15
  - Model::Error - help with error codes
@@ -117,6 +123,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
117
123
  - Authentication
118
124
  - Configuration
119
125
 
126
+ [1.0.1]: https://github.com/WeInfuse/change_health/compare/v1.0.0...v1.0.1
127
+ [1.0.0]: https://github.com/WeInfuse/change_health/compare/v0.15.0...v1.0.0
120
128
  [0.15.0]: https://github.com/WeInfuse/change_health/compare/v0.14.0...v0.15.0
121
129
  [0.14.0]: https://github.com/WeInfuse/change_health/compare/v0.13.0...v0.14.0
122
130
  [0.13.0]: https://github.com/WeInfuse/change_health/compare/v0.12.0...v0.13.0
@@ -72,11 +72,11 @@ module ChangeHealth
72
72
  end
73
73
 
74
74
  def active?(service_code: '30')
75
- return ACTIVE == plan_status(service_code: service_code).dig('statusCode')
75
+ plan_status(service_code: service_code, single: false).any? {|status| ACTIVE == status['statusCode'] }
76
76
  end
77
77
 
78
78
  def inactive?(service_code: '30')
79
- return INACTIVE == plan_status(service_code: service_code).dig('statusCode')
79
+ plan_status(service_code: service_code, single: false).any? {|status| INACTIVE == status['statusCode'] }
80
80
  end
81
81
 
82
82
  def errors?
@@ -131,8 +131,12 @@ module ChangeHealth
131
131
  ChangeHealth::Models::EligibilityData::PARSE_DATE.call(self.plan_date_range[1])
132
132
  end
133
133
 
134
- def plan_status(service_code: )
135
- self.planStatus&.find {|plan| plan.dig('serviceTypeCodes')&.include?(service_code) } || {}
134
+ def plan_status(service_code: , single: true)
135
+ if true == single
136
+ self.planStatus&.find {|plan| plan.dig('serviceTypeCodes')&.include?(service_code) } || {}
137
+ else
138
+ self.planStatus&.select {|plan| plan.dig('serviceTypeCodes')&.include?(service_code) } || []
139
+ end
136
140
  end
137
141
 
138
142
  def benefits
@@ -1,3 +1,3 @@
1
1
  module ChangeHealth
2
- VERSION = '1.0.0'.freeze
2
+ VERSION = '1.0.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: change_health
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Crockett
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-17 00:00:00.000000000 Z
11
+ date: 2021-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty