Class: Codabel::Type::Communication

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

Constant Summary collapse

DEFAULT_STRUCTURED_CODE =
'110'.freeze

Instance Method Summary collapse

Methods inherited from Codabel::Type

#check!

Instance Method Details

#to_coda(value, length) ⇒ Object



6
7
8
9
10
11
# File 'lib/codabel/type/communication.rb', line 6

def to_coda(value, length)
  communication = communication_from(value)
  check!(communication.length <= length, "Communication `#{communication}` is too long")

  communication.ljust(length, ' ')
end