Class EDI::DE
In: lib/edi4r.rb
lib/edi4r/rexml.rb
Parent: EDI::Object

A basic data element. Its content is accessible through methods value and value=. Allowed contents is described by attribute format.

Note that values are usually Strings, or Numerics when the format indicates a numeric value. Other objects are conceivable, as long as they maintain a reasonable to_s for their representation.

The external representation of the (abstract) value may further depend on rules of the unterlying EDI standard. E.g., UN/EDIFACT comes with a set of reserved characters and an escaping mechanism.

Methods

empty?   inspect   new   required?   to_s   to_xml   validate  

Attributes

format  [R] 
status  [R] 
value  [RW] 

Public Class methods

Public Instance methods

Returns true if value is not nil. Note that assigning an empty string to a DE makes it "not empty".

Returns true if this is a required / mandatory segment.

Performs various validation checks and returns the number of issues found (plus the value of err_count):

  • empty while mandatory?
  • character set limitations violated?
  • various format restrictions violated?

[Validate]