Class: Nom::XML::Terminology

Inherits:
Term
  • Object
show all
Defined in:
lib/nom/xml/terminology.rb

Constant Summary

Constants inherited from Term

Nom::XML::Term::PATH_SEPARATOR

Instance Attribute Summary collapse

Attributes inherited from Term

#name, #options, #parent, #terms

Instance Method Summary collapse

Methods inherited from Term

#flatten, #key?, #local_xpath, #method_missing, #nodes, #respond_to_missing?, #to_s, #values

Constructor Details

#initialize(document = nil, options = {}, *args, &block) ⇒ Terminology

Returns a new instance of Terminology


5
6
7
8
9
10
11
12
# File 'lib/nom/xml/terminology.rb', line 5

def initialize document = nil, options = {}, *args, &block
  @terms = {}
  @options = options || {}
  @document = document
  in_edit_context do
    yield(self) if block_given?
  end
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Nom::XML::Term

Instance Attribute Details

#documentObject (readonly)

Returns the value of attribute document


3
4
5
# File 'lib/nom/xml/terminology.rb', line 3

def document
  @document
end

Instance Method Details

#full_nameObject


26
27
28
# File 'lib/nom/xml/terminology.rb', line 26

def full_name
  %Q{Terminology:#{self.object_id}}
end

#namespacesObject


14
15
16
# File 'lib/nom/xml/terminology.rb', line 14

def namespaces
  options[:namespaces] || {}
end

#terminologyObject


18
19
20
# File 'lib/nom/xml/terminology.rb', line 18

def terminology
  self
end

#xpathObject


22
23
24
# File 'lib/nom/xml/terminology.rb', line 22

def xpath
  nil
end