Class: Duxml::AttrsRuleClass
- Inherits:
-
RuleClass
- Object
- PatternClass
- RuleClass
- Duxml::AttrsRuleClass
- Includes:
- AttrsRule, RngAttrsRule
- Defined in:
- lib/duxml/meta/grammar/rule/attrs_rule.rb,
lib/duxml/meta/grammar/relax_ng/attrs_rule.rb
Overview
do not subclass this! as object, consists of subject and a Regexp describing allowable attribute names as well as a String indicating with DTD symbols for whether the given attributes are allowed or required
Instance Attribute Summary collapse
-
#requirement ⇒ Object
readonly
Returns the value of attribute requirement.
Attributes inherited from RuleClass
Attributes included from Reportable
Attributes inherited from PatternClass
Attributes included from Duxml
Attributes included from Saxer
Instance Method Summary collapse
-
#initialize(_subject, attrs, required = '#IMPLIED') ⇒ AttrsRuleClass
constructor
A new instance of AttrsRuleClass.
Methods included from RngAttrsRule
Methods included from LazyOx
Methods included from AttrsRule
#applies_to?, #attr_name, #description, #pass, #qualify, #relationship, #required?
Methods included from Rule
#applies_to?, #description, #history, #qualify
Methods included from Reportable
Methods included from Pattern
#<=>, #abstract?, #concrete?, #description, #name, #object, #relationship, #simple_name, #xml
Methods included from Duxml
Methods included from Saxer
Constructor Details
#initialize(_subject, attrs, required = '#IMPLIED') ⇒ AttrsRuleClass
Returns a new instance of AttrsRuleClass.
17 18 19 20 21 |
# File 'lib/duxml/meta/grammar/rule/attrs_rule.rb', line 17 def initialize(_subject, attrs, required='#IMPLIED') formatted_statement = attrs.gsub('-', '__dash__').gsub(/\b/, '\b').gsub('-', '__dash__') @requirement = required super(_subject, formatted_statement) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Duxml::LazyOx
Instance Attribute Details
#requirement ⇒ Object (readonly)
Returns the value of attribute requirement.
23 24 25 |
# File 'lib/duxml/meta/grammar/rule/attrs_rule.rb', line 23 def requirement @requirement end |