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.
199
200
201
202
203
204
205
206
207
208
|
# File 'lib/stupidedi/schema/element_use.rb', line 199
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
188
189
190
|
# File 'lib/stupidedi/schema/element_use.rb', line 188
def definition
@definition
end
|
197
198
199
|
# File 'lib/stupidedi/schema/element_use.rb', line 197
def parent
@parent
end
|
194
195
196
|
# File 'lib/stupidedi/schema/element_use.rb', line 194
def repeat_count
@repeat_count
end
|
191
192
193
|
# File 'lib/stupidedi/schema/element_use.rb', line 191
def requirement
@requirement
end
|
Instance Method Details
#component? ⇒ Boolean
229
230
231
|
# File 'lib/stupidedi/schema/element_use.rb', line 229
def component?
false
end
|
211
212
213
214
215
216
217
|
# File 'lib/stupidedi/schema/element_use.rb', line 211
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.
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
|
# File 'lib/stupidedi/schema/element_use.rb', line 234
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
219
220
221
|
# File 'lib/stupidedi/schema/element_use.rb', line 219
def repeatable?
@repeat_count.try{|r| r.include?(2) }
end
|
#simple? ⇒ Boolean
224
225
226
|
# File 'lib/stupidedi/schema/element_use.rb', line 224
def simple?
false
end
|