Class: Stupidedi::Versions::FunctionalGroups::ThirtyTen::SyntaxNotes::C
Overview
Conditional: if the first element specified in the condition is present, then all other elements must be specified.
Instance Attribute Summary
#indexes
Class Method Summary
collapse
Instance Method Summary
collapse
#errors, #initialize, #satisfied?
Class Method Details
.build(*args) ⇒ Object
135
136
137
|
# File 'lib/stupidedi/versions/functional_groups/003010/syntax_notes.rb', line 135
def build(*args)
new(args)
end
|
Instance Method Details
#forbidden(zipper) ⇒ Object
125
126
127
|
# File 'lib/stupidedi/versions/functional_groups/003010/syntax_notes.rb', line 125
def forbidden(zipper)
[]
end
|
#reason(zipper) ⇒ Object
129
130
131
|
# File 'lib/stupidedi/versions/functional_groups/003010/syntax_notes.rb', line 129
def reason(zipper)
"elements #{indexes.tail.join(", ")} must be present when element #{indexes.head} is present"
end
|
#required(zipper) ⇒ Object
113
114
115
116
117
118
119
120
121
122
123
|
# File 'lib/stupidedi/versions/functional_groups/003010/syntax_notes.rb', line 113
def required(zipper)
if zipper.node.present?
if zipper.child(indexes.head - 1).node.present?
children(zipper).tail
else
[]
end
else
[]
end
end
|