Class: Stupidedi::Versions::Common::ElementTypes::IdentifierVal::Invalid
Instance Attribute Summary collapse
#position, #usage
Instance Method Summary
collapse
empty, #id?, #too_long?, #too_short?, value
#allowed?, #component?, #date?, #id?, #leaf?, #numeric?, #simple?, #string?, #time?, #too_long?, #too_short?
#element?, #size
#blank?, #characters, #component?, #composite?, #definition, #descriptor, #element?, #functional_group?, #interchange?, #invalid?, #leaf?, #loop?, #present?, #repeated?, #segment?, #separator?, #simple?, #size, #table?, #transaction_set?, #transmission?
Methods included from Color
ansi, #ansi
Constructor Details
#initialize(value, usage, position) ⇒ Invalid
Returns a new instance of Invalid.
72
73
74
75
|
# File 'lib/stupidedi/versions/common/element_types/id.rb', line 72
def initialize(value, usage, position)
@value = value
super(usage, position)
end
|
Instance Attribute Details
#value ⇒ Object
70
71
72
|
# File 'lib/stupidedi/versions/common/element_types/id.rb', line 70
def value
@value
end
|
Instance Method Details
#==(other) ⇒ Boolean
125
126
127
|
# File 'lib/stupidedi/versions/common/element_types/id.rb', line 125
def ==(other)
eql?(other)
end
|
#copy(changes = {}) ⇒ Invalid
78
79
80
|
# File 'lib/stupidedi/versions/common/element_types/id.rb', line 78
def copy(changes = {})
self
end
|
#empty? ⇒ Boolean
86
87
88
|
# File 'lib/stupidedi/versions/common/element_types/id.rb', line 86
def empty?
false
end
|
#inspect ⇒ String
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
|
# File 'lib/stupidedi/versions/common/element_types/id.rb', line 97
def inspect
id = definition.bind do |d|
"[#{"% 5s" % d.id}: #{d.name}]".bind do |s|
if usage.forbidden?
ansi.forbidden(s)
elsif usage.required?
ansi.required(s)
else
ansi.optional(s)
end
end
end
ansi.element("ID.invalid#{id}") + "(#{ansi.invalid(@value.inspect)})"
end
|
91
92
93
|
# File 'lib/stupidedi/versions/common/element_types/id.rb', line 91
def map
self
end
|
#to_s ⇒ String
115
116
117
|
# File 'lib/stupidedi/versions/common/element_types/id.rb', line 115
def to_s
""
end
|
#to_x12(truncate = true) ⇒ String
120
121
122
|
# File 'lib/stupidedi/versions/common/element_types/id.rb', line 120
def to_x12(truncate = true)
""
end
|
#valid? ⇒ Boolean
82
83
84
|
# File 'lib/stupidedi/versions/common/element_types/id.rb', line 82
def valid?
false
end
|