Class: Codabel::Type::AN

Inherits:
Codabel::Type show all
Defined in:
lib/codabel/type/an.rb

Instance Method Summary collapse

Methods inherited from Codabel::Type

#check!

Instance Method Details

#to_coda(value, length) ⇒ Object



4
5
6
7
8
9
# File 'lib/codabel/type/an.rb', line 4

def to_coda(value, length)
  str = value.to_s
  check!(str.length <= length, "Value `#{value}` is too long")

  str.ljust(length, ' ')
end