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.
22 23 24 25 |
# File 'lib/sec_id/concerns/normalizable.rb', line 22 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.
31 32 33 34 |
# File 'lib/sec_id/concerns/normalizable.rb', line 31 def to_pretty_s(id) cleaned = id.to_s.strip.gsub(self::SEPARATORS, '') new(cleaned.upcase).to_pretty_s end |