Class: SecID::FISN
Overview
Financial Instrument Short Name (FISN) - a human-readable short name for financial instruments per ISO 18774.
Format: Issuer Name/Abbreviated Instrument Description
- Total length: 1-35 characters
- Issuer: 1-15 characters (uppercase A-Z, digits 0-9, space)
- Separator: forward slash (/)
- Description: 1-19 characters (uppercase A-Z, digits 0-9, space)
Constant Summary collapse
- FULL_NAME =
Human-readable name of the standard.
'Financial Instrument Short Name'- ID_LENGTH =
Valid length(s) of a normalized identifier.
(3..35)
- EXAMPLE =
A representative valid identifier.
'APPLE INC/SH'- VALID_CHARS_REGEX =
Pattern matching the identifier's permitted character set.
%r{\A[A-Z0-9 /]+\z}- SEPARATORS =
Separators stripped during normalization; spaces are structural here, so only hyphens.
/-/- ID_REGEX =
Regular expression for parsing FISN components. Issuer: 1-15 chars, Description: 1-19 chars, Total: max 35 chars
%r{\A (?<identifier> (?<issuer>[A-Z0-9 ]{1,15}) / (?<description>[A-Z0-9 ]{1,19})) \z}x- FISN_CHARSET =
Characters valid in a FISN segment (alphanumeric and space).
(ALPHANUMERIC + [' ']).freeze
Constants included from Generatable
Generatable::ALPHA, Generatable::ALPHANUMERIC, Generatable::DIGITS
Constants included from Validatable
Instance Attribute Summary collapse
-
#description ⇒ String?
readonly
The abbreviated instrument description (after the slash).
-
#issuer ⇒ String?
readonly
The issuer name portion (before the slash).
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(fisn) ⇒ FISN
constructor
A new instance of FISN.
- #to_s ⇒ String
Methods inherited from Base
#==, #as_json, example, full_name, has_check_digit?, #hash, id_length, length_specificity, length_values, short_name, #to_h
Methods included from Validatable
#errors, #valid?, #validate, #validate!
Methods included from Normalizable
#normalize!, #normalized, #to_pretty_s, #to_str
Constructor Details
#initialize(fisn) ⇒ FISN
Returns a new instance of FISN.
54 55 56 57 58 59 |
# File 'lib/sec_id/fisn.rb', line 54 def initialize(fisn) fisn_parts = parse(fisn) @identifier = fisn_parts[:identifier] @issuer = fisn_parts[:issuer] @description = fisn_parts[:description] end |
Instance Attribute Details
#description ⇒ String? (readonly)
Returns the abbreviated instrument description (after the slash).
51 52 53 |
# File 'lib/sec_id/fisn.rb', line 51 def description @description end |
#issuer ⇒ String? (readonly)
Returns the issuer name portion (before the slash).
48 49 50 |
# File 'lib/sec_id/fisn.rb', line 48 def issuer @issuer end |
Instance Method Details
#to_s ⇒ String
62 63 64 |
# File 'lib/sec_id/fisn.rb', line 62 def to_s identifier.to_s end |