Class: RSS::NokogiriListener

Inherits:
BaseListener
  • Object
show all
Includes:
ListenerMixin
Defined in:
lib/rss/nokogiri.rb

Instance Method Summary collapse

Instance Method Details

#cdata_block(string) ⇒ Object



77
78
79
# File 'lib/rss/nokogiri.rb', line 77

def cdata_block(string)
  text(string)
end

#characters(string) ⇒ Object



63
64
65
# File 'lib/rss/nokogiri.rb', line 63

def characters(string)
  text(string)
end

#comment(string) ⇒ Object



67
68
# File 'lib/rss/nokogiri.rb', line 67

def comment(string)
end

#end_documentObject



33
34
# File 'lib/rss/nokogiri.rb', line 33

def end_document
end

#end_element(name) ⇒ Object



39
40
# File 'lib/rss/nokogiri.rb', line 39

def end_element(name)
end

#end_element_namespace(name, prefix = nil, uri = nil) ⇒ Object



57
58
59
60
61
# File 'lib/rss/nokogiri.rb', line 57

def end_element_namespace(name, prefix = nil, uri = nil)
  name = [prefix, name].compact.join(':')

  tag_end name
end

#error(string) ⇒ Object

Raises:

  • (NotWellFormedError)


73
74
75
# File 'lib/rss/nokogiri.rb', line 73

def error(string)
  raise NotWellFormedError.new(string) if string =~ /Entity '.*' not defined/
end

#start_documentObject



30
31
# File 'lib/rss/nokogiri.rb', line 30

def start_document
end

#start_element(name, attrs = []) ⇒ Object



36
37
# File 'lib/rss/nokogiri.rb', line 36

def start_element(name, attrs = [])
end

#start_element_namespace(name, attributes = [], prefix = nil, uri = nil, ns = []) ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/rss/nokogiri.rb', line 42

def start_element_namespace(name, attributes = [], prefix = nil, uri = nil, ns = [])
  name = [prefix, name].compact.join(':')
  attrs = {}
  attributes.each do |attr|
    key = [attr.prefix, attr.localname].compact.join(':')
    attrs[key] = attr.value
  end
  ns.each do |(prefix, uri)|
    key = ['xmlns', prefix].compact.join(':')
    attrs[key] = uri
  end

  tag_start name, attrs
end

#warning(string) ⇒ Object



70
71
# File 'lib/rss/nokogiri.rb', line 70

def warning(string)
end

#xmldecl(version, encoding, standalone) ⇒ Object



26
27
28
# File 'lib/rss/nokogiri.rb', line 26

def xmldecl version, encoding, standalone
  super(version, encoding, standalone == 'yes')
end