Class: Rubyang::Database::DataTree::LeafListElement

Inherits:
LeafNode
  • Object
show all
Defined in:
lib/rubyang/database/data_tree.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#children, #parent, #schema, #schema_tree

Instance Method Summary collapse

Methods inherited from Node

#evaluate_max_elements, #evaluate_min_elements, #evaluate_musts, #evaluate_whens, #evaluate_xpath, #evaluate_xpath_axis, #evaluate_xpath_expr, #evaluate_xpath_node_test, #evaluate_xpath_path, #evaluate_xpath_predicates, #load_merge_xml_recursive, #root, #to_json, #to_s, #to_xml, #valid?

Constructor Details

#initialize(parent, schema_tree, schema, db_mode, ctx_mode, value) ⇒ LeafListElement

Returns a new instance of LeafListElement.



1097
1098
1099
1100
1101
1102
1103
1104
1105
# File 'lib/rubyang/database/data_tree.rb', line 1097

def initialize parent, schema_tree, schema, db_mode, ctx_mode, value
  @logger = Logger.new(self.class.name)
  @parent = parent
  @schema_tree = schema_tree
  @schema = schema
  @db_mode = db_mode
  @ctx_mode = ctx_mode
  @value = value
end

Instance Attribute Details

#valueObject

Returns the value of attribute value.



1096
1097
1098
# File 'lib/rubyang/database/data_tree.rb', line 1096

def value
  @value
end

Instance Method Details

#to_xml_recursive(_doc, current_namespace) ⇒ Object



1106
1107
1108
1109
1110
1111
1112
1113
# File 'lib/rubyang/database/data_tree.rb', line 1106

def to_xml_recursive _doc, current_namespace
  doc = _doc.add_element( @schema.model.arg )
  unless @schema.namespace == current_namespace
    current_namespace = @schema.namespace
    doc.add_namespace current_namespace
  end
  doc.add_text( @value )
end