Class Wac::Pod::Subpod

  1. lib/wac/pod.rb
Parent: Object

Methods

public class

  1. collection
  2. new

public instance

  1. img
  2. plaintext

Included modules

  1. XmlContainer

Public class methods

collection (xml, options = {})
[show source]
# File lib/wac/pod.rb, line 54
      def self.collection(xml, options = {})
        Nokogiri::XML(xml.to_s).search('subpod').map {|s_xml| new(s_xml, options)}
      end
new (xml, options = {})
[show source]
# File lib/wac/pod.rb, line 58
      def initialize(xml, options = {})
        @query = options[:query]
        @xml = Nokogiri::Slop(xml.to_s).search('subpod').first
        @xml or raise MissingNodeError, "<subpod> node missing from xml: #{xml[0..20]}..."
      end

Public instance methods

img ()
[show source]
# File lib/wac/pod.rb, line 68
      def img
        xml.img
      end
plaintext ()
[show source]
# File lib/wac/pod.rb, line 64
      def plaintext
        xml.plaintext.try(:text)
      end