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.
136
137
138
139
140
141
142
143
144
145
|
# File 'lib/stupidedi/schema/element_use.rb', line 136
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
134
135
136
|
# File 'lib/stupidedi/schema/element_use.rb', line 134
def allowed_values
@allowed_values
end
|
125
126
127
|
# File 'lib/stupidedi/schema/element_use.rb', line 125
def definition
@definition
end
|
131
132
133
|
# File 'lib/stupidedi/schema/element_use.rb', line 131
def parent
@parent
end
|
128
129
130
|
# File 'lib/stupidedi/schema/element_use.rb', line 128
def requirement
@requirement
end
|
Instance Method Details
#component? ⇒ Boolean
172
173
174
|
# File 'lib/stupidedi/schema/element_use.rb', line 172
def component?
true
end
|
148
149
150
151
152
153
154
|
# File 'lib/stupidedi/schema/element_use.rb', line 148
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
157
158
159
|
# File 'lib/stupidedi/schema/element_use.rb', line 157
def parse(string)
definition.parse(string, self)
end
|
#pretty_print(q) ⇒ void
This method returns an undefined value.
177
178
179
180
181
182
183
184
185
186
|
# File 'lib/stupidedi/schema/element_use.rb', line 177
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
162
163
164
|
# File 'lib/stupidedi/schema/element_use.rb', line 162
def repeatable?
false
end
|
#simple? ⇒ Boolean
167
168
169
|
# File 'lib/stupidedi/schema/element_use.rb', line 167
def simple?
true
end
|