Module: Peanuts

Defined in:
lib/peanuts/nuts.rb,
lib/peanuts/xml.rb,
lib/peanuts/mapper.rb,
lib/peanuts/mappings.rb,
lib/peanuts/converters.rb,
lib/peanuts/xml/libxml.rb

Overview

:nodoc:

Defined Under Namespace

Modules: ClassMethods, Converter, InstanceMethods, Mappings, XML Classes: Mapper, Mapping

Class Method Summary collapse

Class Method Details

.included(other) ⇒ Object

:nodoc:



5
6
7
# File 'lib/peanuts/nuts.rb', line 5

def self.included(other) #:nodoc:
  init(other)
end

.init(cls, ns_context = nil, default_ns = nil, &block) ⇒ Object

:nodoc:



9
10
11
12
13
14
15
16
# File 'lib/peanuts/nuts.rb', line 9

def self.init(cls, ns_context = nil, default_ns = nil, &block) #:nodoc:
  cls.instance_eval do
    include InstanceMethods
    extend ClassMethods
    @mapper = Mapper.new(ns_context, default_ns)
    instance_eval(&block) if block_given?
  end
end