Class: Stupidedi::Versions::Common::ElementTypes::DateVal::Invalid
Overview
Models invalid dates, either with a bad format or a date that
does not exist (eg Febuary 30th 2000)
Instance Attribute Summary collapse
#position, #usage
Instance Method Summary
collapse
#date?, empty, #proper?, #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.
62
63
64
65
|
# File 'lib/stupidedi/versions/common/element_types/dt.rb', line 62
def initialize(value, usage, position)
super(usage, position)
@value = value
end
|
Instance Attribute Details
#value ⇒ Object
60
61
62
|
# File 'lib/stupidedi/versions/common/element_types/dt.rb', line 60
def value
@value
end
|
Instance Method Details
#==(other) ⇒ Boolean
110
111
112
|
# File 'lib/stupidedi/versions/common/element_types/dt.rb', line 110
def ==(other)
eql?(other)
end
|
#copy(changes = {}) ⇒ Invalid
115
116
117
|
# File 'lib/stupidedi/versions/common/element_types/dt.rb', line 115
def copy(changes = {})
self
end
|
#empty? ⇒ Boolean
71
72
73
|
# File 'lib/stupidedi/versions/common/element_types/dt.rb', line 71
def empty?
false
end
|
#inspect ⇒ String
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
# File 'lib/stupidedi/versions/common/element_types/dt.rb', line 82
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("DT.invalid#{id}") + "(#{ansi.invalid(@value.inspect)})"
end
|
76
77
78
|
# File 'lib/stupidedi/versions/common/element_types/dt.rb', line 76
def map
self
end
|
#to_s ⇒ String
100
101
102
|
# File 'lib/stupidedi/versions/common/element_types/dt.rb', line 100
def to_s
""
end
|
#to_x12(truncate = true) ⇒ String
105
106
107
|
# File 'lib/stupidedi/versions/common/element_types/dt.rb', line 105
def to_x12(truncate = true)
""
end
|
#valid? ⇒ Boolean
67
68
69
|
# File 'lib/stupidedi/versions/common/element_types/dt.rb', line 67
def valid?
false
end
|