Class: Codabel::Type::N
- Inherits:
-
Codabel::Type
- Object
- Codabel::Type
- Codabel::Type::N
- Defined in:
- lib/codabel/type/n.rb
Instance Method Summary collapse
Methods inherited from Codabel::Type
Instance Method Details
#to_coda(value, length) ⇒ Object
4 5 6 7 8 9 |
# File 'lib/codabel/type/n.rb', line 4 def to_coda(value, length) str = value.to_i.to_s check!(str.length <= length, "Value `#{value}` is too long") str.rjust(length, '0') end |