Module: Xampl::XamplWithoutContent

Defined in:
lib/xamplr/mixins.rb

Instance Method Summary collapse

Instance Method Details

#<<(other) ⇒ Object



54
55
56
57
58
59
60
61
# File 'lib/xamplr/mixins.rb', line 54

def <<(other)
  if (other.respond_to?("append_to"))
    other.append_to(self)
  else
    raise XamplException.new("no content allowed")
  end
  return self
end

#after_visit_by_element_kind(visitor) ⇒ Object



29
30
31
# File 'lib/xamplr/mixins.rb', line 29

def after_visit_by_element_kind(visitor)
  visitor.after_visit_without_content(self)
end

#before_visit_by_element_kind(visitor) ⇒ Object



21
22
23
# File 'lib/xamplr/mixins.rb', line 21

def before_visit_by_element_kind(visitor)
  visitor.before_visit_without_content(self)
end

#childrenObject



17
18
19
# File 'lib/xamplr/mixins.rb', line 17

def children
  return []
end

#has_mixed_contentObject



13
14
15
# File 'lib/xamplr/mixins.rb', line 13

def has_mixed_content
  false
end

#test_to_xml(out = "", rules = nil) ⇒ Object



33
34
35
36
37
38
39
40
41
# File 'lib/xamplr/mixins.rb', line 33

def test_to_xml(out="", rules=nil)
  accessed
  rules = XMLPrinter.new(out) if nil == rules

  rules.attribute(self)
  rules.start_root_element(tag, ns, true)

  return rules.done
end

#test_to_xml_internal(rules) ⇒ Object



43
44
45
46
47
48
49
50
51
52
# File 'lib/xamplr/mixins.rb', line 43

def test_to_xml_internal(rules)
  if rules.persisting && self.persist_required then
    rules.persist_attribute(self)
    rules.persisted_element(tag, ns)
    return
  end

  rules.attribute(self)
  rules.start_element(tag, ns, true)
end

#visit_by_element_kind(visitor) ⇒ Object



25
26
27
# File 'lib/xamplr/mixins.rb', line 25

def visit_by_element_kind(visitor)
  visitor.visit_without_content(self)
end