Class: Peanuts::Mapping

Inherits:
Object
  • Object
show all
Defined in:
lib/peanuts/mappings.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xmlname, options) ⇒ Mapping

Returns a new instance of Mapping.



8
9
10
# File 'lib/peanuts/mappings.rb', line 8

def initialize(xmlname, options)
  @xmlname, @xmlns, @prefix, @options = xmlname.to_s, options.delete(:xmlns), options.delete(:prefix), options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



6
7
8
# File 'lib/peanuts/mappings.rb', line 6

def options
  @options
end

#prefixObject (readonly)

Returns the value of attribute prefix.



6
7
8
# File 'lib/peanuts/mappings.rb', line 6

def prefix
  @prefix
end

#xmlnameObject (readonly)

Returns the value of attribute xmlname.



6
7
8
# File 'lib/peanuts/mappings.rb', line 6

def xmlname
  @xmlname
end

#xmlnsObject (readonly)

Returns the value of attribute xmlns.



6
7
8
# File 'lib/peanuts/mappings.rb', line 6

def xmlns
  @xmlns
end

Class Method Details

.node_type(node_type = nil) ⇒ Object



17
18
19
20
# File 'lib/peanuts/mappings.rb', line 17

def node_type(node_type = nil)
  @node_type = node_type if node_type
  @node_type
end

Instance Method Details

#node_typeObject



12
13
14
# File 'lib/peanuts/mappings.rb', line 12

def node_type
  self.class.node_type
end