Class: WsdlMapper::TypeMapping::Base
- Inherits:
-
Object
- Object
- WsdlMapper::TypeMapping::Base
- Defined in:
- lib/wsdl_mapper/type_mapping/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#xml_types ⇒ Object
Returns the value of attribute xml_types.
Instance Method Summary collapse
-
#initialize(&block) ⇒ Base
constructor
A new instance of Base.
- #maps?(t) ⇒ Boolean
- #register_xml_types(names) ⇒ Object
- #requires ⇒ Object
- #ruby_type ⇒ Object
- #to_ruby(_string) ⇒ Object
- #to_xml(_object) ⇒ Object
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_types ⇒ Object
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
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 |
#requires ⇒ Object
43 44 45 |
# File 'lib/wsdl_mapper/type_mapping/base.rb', line 43 def requires [] end |
#ruby_type ⇒ Object
39 40 41 |
# File 'lib/wsdl_mapper/type_mapping/base.rb', line 39 def ruby_type raise NotImplementedError end |
#to_ruby(_string) ⇒ Object
31 32 33 |
# File 'lib/wsdl_mapper/type_mapping/base.rb', line 31 def to_ruby(_string) raise NotImplementedError end |
#to_xml(_object) ⇒ Object
35 36 37 |
# File 'lib/wsdl_mapper/type_mapping/base.rb', line 35 def to_xml(_object) raise NotImplementedError end |