Module: SecID::IdentifierMetadata::ClassMethods
- Defined in:
- lib/sec_id/concerns/identifier_metadata.rb
Overview
Class methods added when IdentifierMetadata is included.
Instance Method Summary collapse
-
#example ⇒ String
Returns a representative valid identifier string.
-
#full_name ⇒ String
Returns the full human-readable standard name.
-
#has_check_digit? ⇒ Boolean
True if this identifier type uses a check digit.
-
#id_length ⇒ Integer, Range
Returns the fixed length or valid length range for identifiers of this type.
-
#short_name ⇒ String
Returns the unqualified class name (e.g. “ISIN”, “CUSIP”).
Instance Method Details
#example ⇒ String
Returns a representative valid identifier string.
44 45 46 |
# File 'lib/sec_id/concerns/identifier_metadata.rb', line 44 def example self::EXAMPLE end |
#full_name ⇒ String
Returns the full human-readable standard name.
30 31 32 |
# File 'lib/sec_id/concerns/identifier_metadata.rb', line 30 def full_name self::FULL_NAME end |
#has_check_digit? ⇒ Boolean
Returns true if this identifier type uses a check digit.
49 50 51 52 53 |
# File 'lib/sec_id/concerns/identifier_metadata.rb', line 49 def has_check_digit? return @has_check_digit if defined?(@has_check_digit) @has_check_digit = ancestors.include?(SecID::Checkable) end |
#id_length ⇒ Integer, Range
Returns the fixed length or valid length range for identifiers of this type.
37 38 39 |
# File 'lib/sec_id/concerns/identifier_metadata.rb', line 37 def id_length self::ID_LENGTH end |
#short_name ⇒ String
Returns the unqualified class name (e.g. “ISIN”, “CUSIP”).
23 24 25 |
# File 'lib/sec_id/concerns/identifier_metadata.rb', line 23 def short_name @short_name ||= name.split('::').last end |