Method: Wolfram::Pod#initialize

Defined in:
lib/wolfram/pod.rb

#initialize(xml, options = {}) ⇒ Pod

Returns a new instance of Pod.



14
15
16
17
18
19
20
21
# File 'lib/wolfram/pod.rb', line 14

def initialize(xml, options = {})
  @query = options[:query]
  @xml = Nokogiri::XML(xml.to_s).search('pod').first
  @subpods = Subpod.collection(@xml.search('subpod'), options)
  @states = State.collection(@xml.search('states'), options)
  @xml or raise MissingNodeError, "<pod> node missing from xml: #{xml[0..20]}..."
  types.each {|type| extend type}
end