Class: Duxml::ValueRuleClass

Inherits:
RuleClass show all
Includes:
RngValueRule, ValueRule
Defined in:
lib/duxml/meta/grammar/rule/value_rule.rb,
lib/duxml/meta/grammar/relax_ng/value_rule.rb

Overview

rule that states what values a given attribute name is allowed to have

Constant Summary

Constants included from ValueRule

Duxml::ValueRule::CDATA_EXPR, Duxml::ValueRule::ENTITY_EXPR, Duxml::ValueRule::ID_EXPR, Duxml::ValueRule::NMTOKEN_EXPR, Duxml::ValueRule::NOTATION_EXPR

Instance Attribute Summary collapse

Attributes inherited from RuleClass

#object, #statement

Attributes included from Reportable

#observer_peers

Attributes inherited from PatternClass

#subject

Attributes included from Duxml

#doc

Attributes included from Saxer

#io

Instance Method Summary collapse

Methods included from RngValueRule

#relaxng

Methods included from LazyOx

#method_missing

Methods included from ValueRule

#abstract?, #applies_to?, #description, #qualify

Methods included from Rule

#applies_to?, #description, #history, #qualify

Methods included from Reportable

#add_observer

Methods included from Pattern

#<=>, #abstract?, #concrete?, #description, #name, #object, #relationship, #simple_name, #xml

Methods included from Duxml

#load, #log, #save, #validate

Methods included from Saxer

#sax

Constructor Details

#initialize(_attr_name, _statement) ⇒ ValueRuleClass

Returns a new instance of ValueRuleClass.

Parameters:

  • _attr_name (String)

    the attribute name

  • _statement (String)

    data type or expression of the rule for the given attribute’s value



14
15
16
# File 'lib/duxml/meta/grammar/rule/value_rule.rb', line 14

def initialize(_attr_name, _statement)
  @attr_name, @statement = _attr_name, _statement
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Duxml::LazyOx

Instance Attribute Details

#attr_nameObject (readonly)

Returns the value of attribute attr_name.



18
19
20
# File 'lib/duxml/meta/grammar/rule/value_rule.rb', line 18

def attr_name
  @attr_name
end