Class: SecurityIdentifiers::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/security_identifiers/base.rb

Direct Known Subclasses

CUSIP, ISIN, SEDOL

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#original_check_digitObject (readonly)

Returns the value of attribute original_check_digit.



6
7
8
# File 'lib/security_identifiers/base.rb', line 6

def original_check_digit
  @original_check_digit
end

Instance Method Details

#to_sObject



12
13
14
# File 'lib/security_identifiers/base.rb', line 12

def to_s
  "#{@identifier}#{check_digit}"
end

#valid?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/security_identifiers/base.rb', line 8

def valid?
  @original_check_digit.to_i == check_digit
end