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

#initialize(&block) ⇒ Base

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

#xml_typesObject

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

#maps?(t) ⇒ Boolean

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

#register_xml_types(names) ⇒ Object



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

#requiresObject



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

def requires
  []
end

#ruby_typeObject

Raises:

  • (NotImplementedError)


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

def ruby_type
  raise NotImplementedError
end

#to_ruby(_string) ⇒ Object

Raises:

  • (NotImplementedError)


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

def to_ruby(_string)
  raise NotImplementedError
end

#to_xml(_object) ⇒ Object

Raises:

  • (NotImplementedError)


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

def to_xml(_object)
  raise NotImplementedError
end