Class: Stupidedi::Schema::ComponentElementUse
Instance Attribute Summary collapse
Instance Method Summary
collapse
#composite?, #empty, #value
Methods included from Inspect
#inspect
Methods inherited from AbstractUse
#composite?, #definition?, #element?, #functional_group?, #interchange?, #loop?, #repeated?, #segment?, #table?, #transaction_set?, #usage?
Constructor Details
#initialize(definition, requirement, allowed_values, parent) ⇒ ComponentElementUse
Returns a new instance of ComponentElementUse.
133
134
135
136
137
138
139
140
141
142
|
# File 'lib/stupidedi/schema/element_use.rb', line 133
def initialize(definition, requirement, allowed_values, parent)
@definition, @requirement, @allowed_values, @parent =
definition, requirement, allowed_values, parent
unless parent.nil?
@definition = @definition.copy(:parent => self)
end
end
|
Instance Attribute Details
#allowed_values ⇒ AbstractSet
131
132
133
|
# File 'lib/stupidedi/schema/element_use.rb', line 131
def allowed_values
@allowed_values
end
|
122
123
124
|
# File 'lib/stupidedi/schema/element_use.rb', line 122
def definition
@definition
end
|
128
129
130
|
# File 'lib/stupidedi/schema/element_use.rb', line 128
def parent
@parent
end
|
125
126
127
|
# File 'lib/stupidedi/schema/element_use.rb', line 125
def requirement
@requirement
end
|
Instance Method Details
#component? ⇒ Boolean
169
170
171
|
# File 'lib/stupidedi/schema/element_use.rb', line 169
def component?
true
end
|
145
146
147
148
149
150
151
|
# File 'lib/stupidedi/schema/element_use.rb', line 145
def copy(changes = {})
ComponentElementUse.new \
changes.fetch(:definition, @definition),
changes.fetch(:requirement, @requirement),
changes.fetch(:allowed_values, @allowed_values),
changes.fetch(:parent, @parent)
end
|
#parse(string) ⇒ SimpleElementVal
154
155
156
|
# File 'lib/stupidedi/schema/element_use.rb', line 154
def parse(string)
definition.parse(string, self)
end
|
#pretty_print(q) ⇒ void
This method returns an undefined value.
174
175
176
177
178
179
180
181
182
183
|
# File 'lib/stupidedi/schema/element_use.rb', line 174
def pretty_print(q)
q.text("ComponentElementUse")
q.group(2, "(", ")") do
q.breakable ""
q.pp @definition
q.text ","
q.breakable
q.pp @requirement
end
end
|
#repeatable? ⇒ Boolean
159
160
161
|
# File 'lib/stupidedi/schema/element_use.rb', line 159
def repeatable?
false
end
|
#simple? ⇒ Boolean
164
165
166
|
# File 'lib/stupidedi/schema/element_use.rb', line 164
def simple?
true
end
|