posexional v0.5.4 Posexional.Field.Value
this module represent a single field in a row of a positional file
Link to this section Summary
Link to this section Functions
Link to this function
new(name, size, opts \\ [])
Link to this function
write(field, value)
outputs a field
Examples
iex> Posexional.Field.Value.write(Posexional.Field.Value.new(:test, 5), "test")
"test "
iex> Posexional.Field.Value.write(Posexional.Field.Value.new(:test, 5), "too long")
** (RuntimeError) The value too long is too long for the test field. The maximum size is 5 while the value is 8
iex> Posexional.Field.Value.write(Posexional.Field.Value.new(:test, 10), "test")
"test "
iex> Posexional.Field.Value.write(Posexional.Field.Value.new(:test, 10), "test")
"test "
iex> Posexional.Field.Value.write(Posexional.Field.Value.new(:test, 10, filler: ?0), "test")
"test000000"
iex> Posexional.Field.Value.write(Posexional.Field.Value.new(:test, 10, filler: ?0, alignment: :right), "test")
"000000test"
iex> Posexional.Field.Value.write(Posexional.Field.Value.new(:test, 10), 50)
** (RuntimeError) The value provided for the test field doesn't seem to be a string