Class: Nokogiri::XML::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/em-tvdb/client.rb

Instance Method Summary collapse

Instance Method Details

#content_node(css) ⇒ Object



12
13
14
15
16
17
18
19
20
21
# File 'lib/em-tvdb/client.rb', line 12

def content_node(css)
  nodes = css(css)
  if nodes.size == 0
    nil
  elsif nodes.size == 1
    nodes[0].content
  else
    raise "more then one node for #{css}: #{nodes.size}"
  end
end