README.md in sec_id-4.0.0 vs README.md in sec_id-4.1.0

- old
+ new

@@ -9,21 +9,23 @@ Check-digit calculation is also available. Currently supported standards: [ISIN](https://en.wikipedia.org/wiki/International_Securities_Identification_Number), [CUSIP](https://en.wikipedia.org/wiki/CUSIP), -[SEDOL](https://en.wikipedia.org/wiki/SEDOL) +[SEDOL](https://en.wikipedia.org/wiki/SEDOL), +[FIGI](https://en.wikipedia.org/wiki/Financial_Instrument_Global_Identifier), +[CIK](https://en.wikipedia.org/wiki/Central_Index_Key). Work in progress: [IBAN](https://en.wikipedia.org/wiki/International_Bank_Account_Number). ## Installation Add this line to your application's Gemfile: ```ruby -gem 'sec_id', '~> 4.0' +gem 'sec_id', '~> 4.1' ``` And then execute: $ bundle @@ -113,10 +115,11 @@ isin.check_digit # => 5 isin.valid? # => true isin.valid_format? # => true isin.restore! # => 'US5949181045' isin.calculate_check_digit # => 5 +isin.to_cusip # => #<SecId::CUSIP> ``` ### SecId::CUSIP full example ```ruby @@ -134,10 +137,12 @@ cusip.check_digit # => 4 cusip.valid? # => true cusip.valid_format? # => true cusip.restore! # => '594918104' cusip.calculate_check_digit # => 4 +cusip.to_isin('US') # => #<SecId::ISIN> +cusip.cins? # => true ``` ### SecId::SEDOL full example ```ruby @@ -153,9 +158,51 @@ cusip.check_digit # => 5 cusip.valid? # => true cusip.valid_format? # => true cusip.restore! # => 'B0Z52W5' cusip.calculate_check_digit # => 5 +``` + +### SecId::FIGI full example + +```ruby +# class level +SecId::FIGI.valid?('BBG000DMBXR2') # => true +SecId::FIGI.valid_format?('BBG000DMBXR2') # => true +SecId::FIGI.restore!('BBG000DMBXR') # => 'BBG000DMBXR2' +SecId::FIGI.check_digit('BBG000DMBXR') # => 2 + +# instance level +figi = SecId::FIGI.new('BBG000DMBXR2') +figi.full_number # => 'BBG000DMBXR2' +figi.prefix # => 'BB' +figi.random_part # => '000DMBXR' +figi.check_digit # => 2 +figi.valid? # => true +figi.valid_format? # => true +figi.restore! # => 'BBG000DMBXR2' +figi.calculate_check_digit # => 2 +``` + +### SecId::CIK full example + +```ruby +# class level +SecId::CIK.valid?('0001094517') # => true +SecId::CIK.valid_format?('0001094517') # => true +SecId::CIK.restore!('1094517') # => '0001094517' +SecId::CIK.check_digit('0001094517') # raises NotImplementedError + +# instance level +cik = SecId::CIK.new('0001094517') +cik.full_number # => '0001094517' +cik.padding # => '000' +cik.identifier # => '1094517' +cik.valid? # => true +cik.valid_format? # => true +cik.restore! # => '0001094517' +cik.calculate_check_digit # raises NotImplementedError +cik.check_digit # => nil ``` ## Development After checking out the repo, run `bin/setup` to install dependencies.