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



23
24
25
# File 'lib/peanuts/xml.rb', line 23

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

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



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

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

.schema(schema_type, source, source_type = :string) ⇒ Object



27
28
29
# File 'lib/peanuts/xml.rb', line 27

def self.schema(schema_type, source, source_type = :string)
  default.schema(schema_type, source, source_type)
end