Skip to content
Merged
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

1. Adds `Entity::Fund` `active?` and `default?` interrogatives

## [4.0.1] - 2024-09-13

This version adds support for Ruby 3.3.5. No real changes were required. We just needed to add some gems to the gemspec
Expand Down
102 changes: 58 additions & 44 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
PATH
remote: .
specs:
faithteams-api (4.0.1)
activesupport (~> 7.0.8)
faithteams-api (4.1.1)
activesupport (>= 7.0.8, <= 7.1.5.1)
http (~> 5.1)
logger (~> 1.6.1)
ostruct (~> 0.6.0)
Expand All @@ -11,31 +11,42 @@ PATH
GEM
remote: https://rubygems.org/
specs:
activesupport (7.0.8.4)
activesupport (7.1.5.1)
base64
benchmark (>= 0.3)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
logger (>= 1.4.2)
minitest (>= 5.1)
mutex_m
securerandom (>= 0.3)
tzinfo (~> 2.0)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
ast (2.4.2)
base64 (0.2.0)
bigdecimal (3.1.7)
benchmark (0.4.0)
bigdecimal (3.1.8)
byebug (11.1.3)
coderay (1.1.3)
concurrent-ruby (1.2.3)
concurrent-ruby (1.3.4)
connection_pool (2.4.1)
crack (1.0.0)
bigdecimal
rexml
diff-lcs (1.5.1)
docile (1.4.0)
docile (1.4.1)
domain_name (0.6.20240107)
ffi (1.16.3)
drb (2.2.1)
ffi (1.17.0)
ffi-compiler (1.3.2)
ffi (>= 1.15.5)
rake
formatador (1.1.0)
guard (2.18.1)
guard (2.19.0)
formatador (>= 0.2.4)
listen (>= 2.7, < 4.0)
lumberjack (>= 1.0.12, < 2.0)
Expand All @@ -49,101 +60,104 @@ GEM
guard (~> 2.1)
guard-compat (~> 1.1)
rspec (>= 2.99.0, < 4.0)
hashdiff (1.1.0)
hashdiff (1.1.2)
http (5.2.0)
addressable (~> 2.8)
base64 (~> 0.1)
http-cookie (~> 1.0)
http-form_data (~> 2.2)
llhttp-ffi (~> 0.5.0)
http-cookie (1.0.5)
http-cookie (1.0.8)
domain_name (~> 0.5)
http-form_data (2.3.0)
i18n (1.14.4)
i18n (1.14.6)
concurrent-ruby (~> 1.0)
json (2.7.1)
json (2.9.0)
language_server-protocol (3.17.0.3)
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
llhttp-ffi (0.5.0)
ffi-compiler (~> 1.0)
rake (~> 13.0)
logger (1.6.1)
logger (1.6.3)
lumberjack (1.2.10)
method_source (1.0.0)
minitest (5.22.3)
method_source (1.1.0)
minitest (5.25.4)
mutex_m (0.3.0)
nenv (0.3.0)
notiffany (0.1.3)
nenv (~> 0.1)
shellany (~> 0.0)
ostruct (0.6.0)
parallel (1.24.0)
parser (3.3.0.5)
ostruct (0.6.1)
parallel (1.26.3)
parser (3.3.6.0)
ast (~> 2.4.1)
racc
pry (0.14.2)
pry (0.15.0)
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (5.0.5)
racc (1.7.3)
public_suffix (6.0.1)
racc (1.8.1)
rainbow (3.1.1)
rake (13.2.0)
rake (13.2.1)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
rb-inotify (0.11.1)
ffi (~> 1.0)
regexp_parser (2.9.0)
rexml (3.3.7)
regexp_parser (2.9.3)
rexml (3.3.9)
rspec (3.13.0)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.0)
rspec-core (3.13.2)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.0)
rspec-expectations (3.13.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.0)
rspec-mocks (3.13.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.1)
rubocop (1.62.1)
rspec-support (3.13.2)
rubocop (1.69.2)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.31.1, < 2.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.36.2, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.31.2)
parser (>= 3.3.0.4)
rubocop-performance (1.21.0)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.37.0)
parser (>= 3.3.1.0)
rubocop-performance (1.23.0)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rake (0.6.0)
rubocop (~> 1.0)
rubocop-rspec (1.42.0)
rubocop (>= 0.87.0)
ruby-progressbar (1.13.0)
securerandom (0.4.1)
shellany (0.0.1)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov-html (0.13.1)
simplecov_json_formatter (0.1.4)
thor (1.3.1)
thor (1.3.2)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.5.0)
webmock (3.23.0)
unicode-display_width (3.1.2)
unicode-emoji (~> 4.0, >= 4.0.4)
unicode-emoji (4.0.4)
webmock (3.24.0)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
yard (0.9.36)
yard (0.9.37)

PLATFORMS
ruby
Expand Down
2 changes: 1 addition & 1 deletion faithteams-api.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]

spec.add_dependency "activesupport", "~> 7.0.8"
spec.add_dependency "activesupport", ">= 7.0.8", "<= 7.1.5.1"
spec.add_dependency "http", "~> 5.1"
spec.add_dependency "logger", "~> 1.6.1"
spec.add_dependency "ostruct", "~> 0.6.0"
Expand Down
10 changes: 10 additions & 0 deletions lib/faithteams/api/v2/entity/fund.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ def default
read_attribute(:isDefault).presence
end

# @return [Boolean]
def default?
default == "Y"
end

# @return [String, nil]
def description
read_attribute(:description).presence
Expand Down Expand Up @@ -41,6 +46,11 @@ def status
read_attribute(:status).presence
end

# @return [Boolean]
def active?
status == "A"
end

# @return [String, nil] "T" for true?, "Y" for yes?
def tax_deductible
read_attribute(:taxDeductible).presence
Expand Down
2 changes: 1 addition & 1 deletion lib/faithteams/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

module FaithTeams
# Current version number.
VERSION = "4.0.1"
VERSION = "4.1.1"
end
30 changes: 30 additions & 0 deletions spec/faithteams/api/v2/entity/fund_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,21 @@
end
end

describe "#default?" do
context "when default is 'Y'" do
it "returns true" do
fund = described_class.new(attributes: { "isDefault" => "Y" })
expect(fund).to be_default
end
end

context "when default isn't 'Y'" do
it "returns false" do
expect(fund).not_to be_default
end
end
end

describe "description" do
it "is a String" do
expect(fund.description).to be_instance_of(String)
Expand Down Expand Up @@ -64,6 +79,21 @@
end
end

describe "#active?" do
context "when status is 'A'" do
it "returns true" do
expect(fund).to be_active
end
end

context "when status isn't 'A'" do
it "returns false" do
fund = described_class.new(attributes: { "status" => "I" })
expect(fund).not_to be_active
end
end
end

describe "tax_deductible" do
it "is a String" do
expect(fund.tax_deductible).to be_instance_of(String)
Expand Down
Loading