sensei_eod_utils 0.0.30 → 0.0.31

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: 62640d75f99b86b6a60621a710b0e7baf031cde569682a3637daeb358ee76cc1
4
- data.tar.gz: f4c6e3b34f7e63b89c9f7b3b78aeac6f2dadc8a57ceeda461be1295d9454f11d
3
+ metadata.gz: 5d6b956c73badfbaeb9920f1df08838ebd17d791cd7abc46a8fd28087e528264
4
+ data.tar.gz: ce006b39ffa6bf2e8ddd5c6cd473ea8d429e3c881a177a44d6c13c3cc5c24865
5
5
  SHA512:
6
- metadata.gz: fa8354a91eac062cf40b2d74ee7cb9ee9755e4f0c2069f6af93666622d80312d9452e4d76b1c3a5bf47e4c5583afe97ec5f2cb49e1ccfe55ef0fde95b7a09115
7
- data.tar.gz: 7f5b2a251e5c5426c56d61ddae38cd666e9bc014120df877a93f918e7cec1edf3379bbcb990204a6048687a48ed960112c0ccb514c07d324b8c27d15f27dcd08
6
+ metadata.gz: f6c8fb2fe24dace721dbdb81aa27a4dccf9bb13cf2e97d2f0ffbaa916fbdb56ae880338c91260bd21b7e3cc448434490244ea117455dc91a93d977bc98cf9eaf
7
+ data.tar.gz: da2d455f1645e556ef0e483381173d423409c3422b7ccaceed373b67d4440a588d8006c2fb94120972ff4d65b9c625bf4302628e79e1dcb3b51d8c182c444369
@@ -10,7 +10,13 @@ module EodServices
10
10
  def contract_symbol(underlying:, expiry:, type:, strike:)
11
11
  return underlying if type == EodModels::OptionType::STOCK
12
12
 
13
- underlying + expiration(expiry) + type + padded_strike(strike)
13
+ contract = underlying + expiration(expiry) + type + padded_strike(strike)
14
+
15
+ unless EodServices::InstrumentType.option?(contract)
16
+ raise ArgumentError, "Contract #{contract} is not a valid options contract"
17
+ end
18
+
19
+ contract
14
20
  end
15
21
 
16
22
  def underlying_symbol(contract_symbol)
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'sensei_eod_utils'
5
- s.version = '0.0.30'
5
+ s.version = '0.0.31'
6
6
  s.date = '2019-12-20'
7
7
  s.summary = 'Sensei trader utility functions and Eod api facade'
8
8
  s.authors = ['Nishant Shah']
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensei_eod_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.30
4
+ version: 0.0.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nishant Shah