Class: WsdlMapper::TypeMapping::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/wsdl_mapper/type_mapping/base.rb

Direct Known Subclasses

DateParts::Base

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Base) initialize(&block)

Returns a new instance of Base



10
11
12
13
# File 'lib/wsdl_mapper/type_mapping/base.rb', line 10

def initialize(&block)
  instance_exec &block
  MappingSet.default << self
end

Instance Attribute Details

- (Object) xml_types

Returns the value of attribute xml_types



8
9
10
# File 'lib/wsdl_mapper/type_mapping/base.rb', line 8

def xml_types
  @xml_types
end

Instance Method Details

- (Boolean) maps?(t)

Returns:



23
24
25
26
27
28
29
# File 'lib/wsdl_mapper/type_mapping/base.rb', line 23

def maps?(t)
  if t.is_a?(WsdlMapper::Dom::Name)
    xml_types.include? t
  elsif t.is_a?(WsdlMapper::Dom::TypeBase)
    xml_types.include? t.name
  end
end

- (Object) register_xml_types(names)



15
16
17
18
19
20
21
# File 'lib/wsdl_mapper/type_mapping/base.rb', line 15

def register_xml_types(names)
  self.xml_types ||= []
  names.each do |name_or_qname|
    qname = name_or_qname.is_a?(WsdlMapper::Dom::Name) ? name_or_qname : WsdlMapper::Dom::BuiltinType[name_or_qname].name
    self.xml_types << qname
  end
end

- (Object) requires



43
44
45
# File 'lib/wsdl_mapper/type_mapping/base.rb', line 43

def requires
  []
end

- (Object) ruby_type

Raises:

  • (NotImplementedError)


39
40
41
# File 'lib/wsdl_mapper/type_mapping/base.rb', line 39

def ruby_type
  raise NotImplementedError
end

- (Object) to_ruby(string)

Raises:

  • (NotImplementedError)


31
32
33
# File 'lib/wsdl_mapper/type_mapping/base.rb', line 31

def to_ruby(string)
  raise NotImplementedError
end

- (Object) to_xml(object)

Raises:

  • (NotImplementedError)


35
36
37
# File 'lib/wsdl_mapper/type_mapping/base.rb', line 35

def to_xml(object)
  raise NotImplementedError
end