Module: Wolfram::XmlContainer

Included in:
Assumption, Assumption::Value, Pod, Pod::Subpod, Result
Defined in:
lib/wolfram/xml_container.rb

Overview

include this module to get sensible default methods for xml container classes

Instance Attribute Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args) ⇒ Object (protected)



22
23
24
25
26
27
28
# File 'lib/wolfram/xml_container.rb', line 22

def method_missing(method, *args)
  if xml.key?(method.to_s)
    xml_value(xml[method.to_s])
  else
    super
  end
end

Instance Attribute Details

#xmlObject (readonly)

Returns the value of attribute xml.



4
5
6
# File 'lib/wolfram/xml_container.rb', line 4

def xml
  @xml
end

Instance Method Details

#respond_to?(method, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/wolfram/xml_container.rb', line 6

def respond_to?(method, include_private = false)
  xml.key?(method.to_s) || super
end