Module: SecID::Normalizable::ClassMethods
- Defined in:
- lib/sec_id/concerns/normalizable.rb
Overview
Class methods added when Normalizable is included.
Instance Method Summary collapse
-
#normalize(id) ⇒ String
Normalizes the identifier to its canonical format.
-
#to_pretty_s(id) ⇒ String?
Returns a human-readable formatted string, or nil if invalid.
Instance Method Details
#normalize(id) ⇒ String
Normalizes the identifier to its canonical format.
27 28 29 30 |
# File 'lib/sec_id/concerns/normalizable.rb', line 27 def normalize(id) cleaned = id.to_s.strip.gsub(self::SEPARATORS, '') new(cleaned.upcase).normalized end |
#to_pretty_s(id) ⇒ String?
Returns a human-readable formatted string, or nil if invalid.
36 37 38 39 |
# File 'lib/sec_id/concerns/normalizable.rb', line 36 def to_pretty_s(id) cleaned = id.to_s.strip.gsub(self::SEPARATORS, '') new(cleaned.upcase).to_pretty_s end |