fat_core 0.2.8 → 0.2.9

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
  SHA1:
3
- metadata.gz: c5ed9e5648eeb55ee7853b351b5f2f9fa3cb2b4e
4
- data.tar.gz: 8b2cf74d3c6cb40a6adae6ed48fd4077da877e00
3
+ metadata.gz: 35128d619a5a539a01d9dca576d4320a4b92376f
4
+ data.tar.gz: a49087393debc6cbe6671ab032c150ff911e80c9
5
5
  SHA512:
6
- metadata.gz: 0d9379cabd3a65bc7db3260d467d86edf7c7288ba09bb343cbe2024e67b7d1b0bb6b50e7ca5bed5fe3e90d41e7c9a31c757a3ac4cecdbaeeb98c5da73cb71cd4
7
- data.tar.gz: aeddbd7df46977a283259415bc3e2739d82280e19fe1380886dad050e888c3e9e3dd349a45b3c64f67201f03f77007b8bdd9a352a2eb0d8cc220675e8502a006
6
+ metadata.gz: cd166e12d04182998e3daf894fac4d30f9979b4ce168047a782e279897c51783395a02a81f9044beb10e496be0b1dbcf4e951bfd7fee4ed0f2b38fadaca4d5ed
7
+ data.tar.gz: 7904ddf24bcb792d71e373e50f9f9be05b82169f1e013da76d04f3586a512ce0bd313dd7d24a7dc72142221e35a5344d47e8d6913e5253048a5f7e1976bd0141
data/lib/fat_core/date.rb CHANGED
@@ -829,6 +829,7 @@ class Date
829
829
  def nyse_workday?
830
830
  !nyse_holiday?
831
831
  end
832
+ alias :trading_day? :nyse_workday?
832
833
 
833
834
  def add_fed_business_days(n)
834
835
  d = self.dup
@@ -869,8 +870,10 @@ class Date
869
870
  def next_nyse_workday
870
871
  add_nyse_business_days(1)
871
872
  end
873
+ alias :next_trading_day :next_nyse_workday
872
874
 
873
875
  def prior_nyse_workday
874
876
  add_nyse_business_days(-1)
875
877
  end
878
+ alias :prior_trading_day :prior_nyse_workday
876
879
  end
@@ -1,7 +1,7 @@
1
1
  module FatCore
2
2
  MAJOR = 0
3
3
  MINOR = 2
4
- PATCH = 8
4
+ PATCH = 9
5
5
 
6
6
  VERSION = [MAJOR, MINOR, PATCH].compact.join('.')
7
7
  end
@@ -789,6 +789,10 @@ describe Date do
789
789
  # Weekends are holidays, regardless
790
790
  expect(Date.parse('2014-11-22')).not_to be_nyse_workday
791
791
  expect(Date.parse('2014-11-23')).not_to be_nyse_workday
792
+
793
+ # Alias to trading_day?
794
+ expect(Date.parse('2014-11-22')).not_to be_trading_day
795
+ expect(Date.parse('2014-11-23')).not_to be_trading_day
792
796
  end
793
797
 
794
798
  it "should know the next federal workday" do
@@ -816,6 +820,8 @@ describe Date do
816
820
  .to eq Date.parse('2016-04-21')
817
821
  expect(Date.parse('2016-04-22').next_nyse_workday)
818
822
  .to eq Date.parse('2016-04-25')
823
+ expect(Date.parse('2016-04-22').next_trading_day)
824
+ .to eq Date.parse('2016-04-25')
819
825
  end
820
826
 
821
827
  it "should know the prior NYSE workday" do
@@ -829,6 +835,8 @@ describe Date do
829
835
  .to eq Date.parse('2016-04-20')
830
836
  expect(Date.parse('2016-04-25').prior_nyse_workday)
831
837
  .to eq Date.parse('2016-04-22')
838
+ expect(Date.parse('2016-04-25').prior_trading_day)
839
+ .to eq Date.parse('2016-04-22')
832
840
  end
833
841
  end
834
842
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fat_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel E. Doherty