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

Instance Method Details

#exampleString

Returns a representative valid identifier string.

Returns:

  • (String)


44
45
46
# File 'lib/sec_id/concerns/identifier_metadata.rb', line 44

def example
  self::EXAMPLE
end

#full_nameString

Returns the full human-readable standard name.

Returns:

  • (String)


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.

Returns:

  • (Boolean)

    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_lengthInteger, Range

Returns the fixed length or valid length range for identifiers of this type.

Returns:

  • (Integer, Range)


37
38
39
# File 'lib/sec_id/concerns/identifier_metadata.rb', line 37

def id_length
  self::ID_LENGTH
end

#short_nameString

Returns the unqualified class name (e.g. “ISIN”, “CUSIP”).

Returns:

  • (String)


23
24
25
# File 'lib/sec_id/concerns/identifier_metadata.rb', line 23

def short_name
  @short_name ||= name.split('::').last
end