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