Class: Stupidedi::Schema::CompositeElementUse
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, repeat_count, parent) ⇒ CompositeElementUse
Returns a new instance of CompositeElementUse.
202
203
204
205
206
207
208
209
210
211
|
# File 'lib/stupidedi/schema/element_use.rb', line 202
def initialize(definition, requirement, repeat_count, parent)
@definition, @requirement, @repeat_count, @parent =
definition, requirement, repeat_count, parent
unless parent.nil?
@definition = @definition.copy(:parent => self)
end
end
|
Instance Attribute Details
191
192
193
|
# File 'lib/stupidedi/schema/element_use.rb', line 191
def definition
@definition
end
|
200
201
202
|
# File 'lib/stupidedi/schema/element_use.rb', line 200
def parent
@parent
end
|
197
198
199
|
# File 'lib/stupidedi/schema/element_use.rb', line 197
def repeat_count
@repeat_count
end
|
194
195
196
|
# File 'lib/stupidedi/schema/element_use.rb', line 194
def requirement
@requirement
end
|
Instance Method Details
#component? ⇒ Boolean
232
233
234
|
# File 'lib/stupidedi/schema/element_use.rb', line 232
def component?
false
end
|
214
215
216
217
218
219
220
|
# File 'lib/stupidedi/schema/element_use.rb', line 214
def copy(changes = {})
CompositeElementUse.new \
changes.fetch(:definition, @definition),
changes.fetch(:requirement, @requirement),
changes.fetch(:repeat_count, @repeat_count),
changes.fetch(:parent, @parent)
end
|
#pretty_print(q) ⇒ void
This method returns an undefined value.
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
|
# File 'lib/stupidedi/schema/element_use.rb', line 237
def pretty_print(q)
q.text("CompositeElementUse")
q.group(2, "(", ")") do
q.breakable ""
q.pp @definition
q.text ","
q.breakable
q.pp @requirement
q.text ","
q.breakable
q.pp @repeat_count
end
end
|
#repeatable? ⇒ Boolean
222
223
224
|
# File 'lib/stupidedi/schema/element_use.rb', line 222
def repeatable?
@repeat_count.try{|r| r.include?(2) }
end
|
#simple? ⇒ Boolean
227
228
229
|
# File 'lib/stupidedi/schema/element_use.rb', line 227
def simple?
false
end
|