Module: Peanuts::XML

Defined in:
lib/peanuts/xml.rb,
lib/peanuts/xml/libxml.rb

Defined Under Namespace

Modules: LibXML Classes: Reader, Writer

Class Method Summary collapse

Class Method Details

.defaultObject



25
26
27
# File 'lib/peanuts/xml.rb', line 25

def self.default
  @@default ||= LibXML
end

.method_missing(method, *args, &block) ⇒ Object



33
34
35
36
37
38
39
40
# File 'lib/peanuts/xml.rb', line 33

def self.method_missing(method, *args, &block)
  case method.to_s
  when /^(.*)_schema_from_(.*)$/
    XML.schema($1.to_sym, args.first)
  else
    super
  end
end

.schema(schema_type, source) ⇒ Object



29
30
31
# File 'lib/peanuts/xml.rb', line 29

def self.schema(schema_type, source)
  default.schema(schema_type, source)
end