Class: Duxml::RuleClass

Inherits:
PatternClass show all
Includes:
Rule
Defined in:
lib/duxml/meta/grammar/rule.rb

Overview

as an object, Rules consist of a subject, representing the XML Element, and a statement representing the Rule’s logic this class cannot be used alone and is rather subclassed, one for each type of possible XML changes

Constant Summary

Constants included from Duxml

DITA_GRAMMAR

Constants included from Meta

Meta::FILE_EXT

Instance Attribute Summary collapse

Attributes inherited from PatternClass

#subject

Attributes included from Duxml

#doc, #file, #meta

Attributes included from Saxer

#io

Instance Method Summary collapse

Methods included from Rule

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

Methods included from Reportable

#add_observer

Methods included from Pattern

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

Methods included from Duxml

#create, #load, #log, #relaxng, #save, #validate

Methods included from Meta

#grammar=, meta_path, xml

Methods included from Saxer

#sax

Constructor Details

#initialize(subj, _statement) ⇒ RuleClass

Returns a new instance of RuleClass.

Parameters:

  • subj (String)

    NMTOKEN name of element this rule applies to

  • _statement (String, Regexp)

    string statement of rule in DTD declaration form or Regexp



22
23
24
25
26
# File 'lib/duxml/meta/grammar/rule.rb', line 22

def initialize(subj, _statement)
  @statement = _statement
  @object = nil
  super subj
end

Instance Attribute Details

#objectObject (readonly)

Returns the value of attribute object.



28
29
30
# File 'lib/duxml/meta/grammar/rule.rb', line 28

def object
  @object
end

#statementObject (readonly)

Returns the value of attribute statement.



28
29
30
# File 'lib/duxml/meta/grammar/rule.rb', line 28

def statement
  @statement
end