Class: Stupidedi::Versions::FunctionalGroups::ThirtyForty::SyntaxNotes::E

Inherits:
Schema::SyntaxNote
  • Object
show all
Defined in:
lib/stupidedi/versions/functional_groups/003040/syntax_notes.rb

Overview

Exclusion: not more than one of the elements in the condition may be present

Instance Attribute Summary

Attributes inherited from Schema::SyntaxNote

#indexes

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Schema::SyntaxNote

#errors, #initialize, #satisfied?

Constructor Details

This class inherits a constructor from Stupidedi::Schema::SyntaxNote

Class Method Details

.build(*args) ⇒ Object



103
104
105
# File 'lib/stupidedi/versions/functional_groups/003040/syntax_notes.rb', line 103

def build(*args)
  new(args)
end

Instance Method Details

#forbidden(zipper) ⇒ Object



87
88
89
90
91
92
93
94
# File 'lib/stupidedi/versions/functional_groups/003040/syntax_notes.rb', line 87

def forbidden(zipper)
  if zipper.node.present?
    xs = children(zipper)
    xs.count{|x| x.node.present? } <= 1 ? [] : xs
  else
    []
  end
end

#reason(zipper) ⇒ Object



96
97
98
99
# File 'lib/stupidedi/versions/functional_groups/003040/syntax_notes.rb', line 96

def reason(zipper)
  present = indexes.select{|n| zipper.child(n - 1).node.present? }
  "only one of elements #{present.join(", ")} may be present"
end

#required(zipper) ⇒ Object



83
84
85
# File 'lib/stupidedi/versions/functional_groups/003040/syntax_notes.rb', line 83

def required(zipper)
  []
end