Class: Stupidedi::Versions::Interchanges::FourHundred::ElementDefs::SeparatorElementVal
Instance Attribute Summary
#position, #usage
Instance Method Summary
collapse
#allowed?, #component?, #date?, #id?, #leaf?, #numeric?, #simple?, #string?, #time?
#element?, #size
#blank?, #characters, #component?, #composite?, #definition, #element?, #functional_group?, #interchange?, #invalid?, #loop?, #present?, #repeated?, #segment?, #simple?, #size, #table?, #transaction_set?, #transmission?
Methods included from Color
ansi, #ansi
Constructor Details
Returns a new instance of SeparatorElementVal.
61
62
63
64
|
# File 'lib/stupidedi/versions/interchanges/00400/element_defs.rb', line 61
def initialize(value, usage, position)
@value = value
super(usage, position)
end
|
Class Method Details
.empty(usage, position) ⇒ Object
110
111
112
|
# File 'lib/stupidedi/versions/interchanges/00400/element_defs.rb', line 110
def empty(usage, position)
SeparatorElementVal.new(nil, usage, position)
end
|
120
121
122
|
# File 'lib/stupidedi/versions/interchanges/00400/element_defs.rb', line 120
def parse(character, usage, position)
SeparatorElementVal.new(character, usage, position)
end
|
115
116
117
|
# File 'lib/stupidedi/versions/interchanges/00400/element_defs.rb', line 115
def value(character, usage, position)
SeparatorElementVal.new(character, usage, position)
end
|
Instance Method Details
67
68
69
70
71
72
|
# File 'lib/stupidedi/versions/interchanges/00400/element_defs.rb', line 67
def copy(changes = {})
SeparatorElementVal.new \
changes.fetch(:value, @value),
changes.fetch(:usage, usage),
changes.fetch(:position, position)
end
|
#empty? ⇒ Boolean
78
79
80
|
# File 'lib/stupidedi/versions/interchanges/00400/element_defs.rb', line 78
def empty?
@value.blank?
end
|
#inspect ⇒ Object
99
100
101
102
|
# File 'lib/stupidedi/versions/interchanges/00400/element_defs.rb', line 99
def inspect
id = definition.try{|d| ansi.bold("[#{d.id}]") }
ansi.element("SeparatorElementVal.value#{id}") << "(#{@value || "nil"})"
end
|
#separator? ⇒ Boolean
90
91
92
|
# File 'lib/stupidedi/versions/interchanges/00400/element_defs.rb', line 90
def separator?
true
end
|
#to_x12 ⇒ String
95
96
97
|
# File 'lib/stupidedi/versions/interchanges/00400/element_defs.rb', line 95
def to_x12
@value.to_s
end
|
#too_long? ⇒ Boolean
86
87
88
|
# File 'lib/stupidedi/versions/interchanges/00400/element_defs.rb', line 86
def too_long?
@value.length > 1
end
|
#too_short? ⇒ Boolean
82
83
84
|
# File 'lib/stupidedi/versions/interchanges/00400/element_defs.rb', line 82
def too_short?
@value.length < 1
end
|
#valid? ⇒ Boolean
74
75
76
|
# File 'lib/stupidedi/versions/interchanges/00400/element_defs.rb', line 74
def valid?
true
end
|