Class: ActionService::Protocol::Soap::SoapMapping
- Inherits:
-
Object
- Object
- ActionService::Protocol::Soap::SoapMapping
- Defined in:
- lib/action_service/protocol/soap.rb
Overview
:nodoc:
Direct Known Subclasses
Instance Attribute Summary collapse
-
#generated_klass ⇒ Object
readonly
Returns the value of attribute generated_klass.
-
#registry_mapping ⇒ Object
readonly
Returns the value of attribute registry_mapping.
-
#ruby_klass ⇒ Object
readonly
Returns the value of attribute ruby_klass.
-
#soap_klass ⇒ Object
readonly
Returns the value of attribute soap_klass.
Instance Method Summary collapse
- #custom_type? ⇒ Boolean
- #each_attribute(&block) ⇒ Object
-
#initialize(mapper, type_name, ruby_klass, generated_klass, soap_klass, registry_mapping, custom_type = false) ⇒ SoapMapping
constructor
A new instance of SoapMapping.
- #is_xsd_type?(klass) ⇒ Boolean
- #qualified_type_name ⇒ Object
- #type_name ⇒ Object
- #xsd_type_for(klass) ⇒ Object
Constructor Details
#initialize(mapper, type_name, ruby_klass, generated_klass, soap_klass, registry_mapping, custom_type = false) ⇒ SoapMapping
Returns a new instance of SoapMapping.
400 401 402 403 404 405 406 407 408 409 |
# File 'lib/action_service/protocol/soap.rb', line 400 def initialize(mapper, type_name, ruby_klass, generated_klass, soap_klass, registry_mapping, custom_type=false) @mapper = mapper @type_name = type_name @ruby_klass = ruby_klass @generated_klass = generated_klass @soap_klass = soap_klass @registry_mapping = registry_mapping @custom_type = custom_type end |
Instance Attribute Details
#generated_klass ⇒ Object (readonly)
Returns the value of attribute generated_klass.
396 397 398 |
# File 'lib/action_service/protocol/soap.rb', line 396 def generated_klass @generated_klass end |
#registry_mapping ⇒ Object (readonly)
Returns the value of attribute registry_mapping.
398 399 400 |
# File 'lib/action_service/protocol/soap.rb', line 398 def registry_mapping @registry_mapping end |
#ruby_klass ⇒ Object (readonly)
Returns the value of attribute ruby_klass.
395 396 397 |
# File 'lib/action_service/protocol/soap.rb', line 395 def ruby_klass @ruby_klass end |
#soap_klass ⇒ Object (readonly)
Returns the value of attribute soap_klass.
397 398 399 |
# File 'lib/action_service/protocol/soap.rb', line 397 def soap_klass @soap_klass end |
Instance Method Details
#custom_type? ⇒ Boolean
415 416 417 |
# File 'lib/action_service/protocol/soap.rb', line 415 def custom_type? @custom_type end |
#each_attribute(&block) ⇒ Object
428 429 430 431 432 433 434 435 436 |
# File 'lib/action_service/protocol/soap.rb', line 428 def each_attribute(&block) if @ruby_klass.respond_to?(:members) @ruby_klass.members.each do |name, klass| name = name.to_s mapping = @mapper.lookup(klass) yield name, mapping.qualified_type_name, mapping end end end |
#is_xsd_type?(klass) ⇒ Boolean
438 439 440 |
# File 'lib/action_service/protocol/soap.rb', line 438 def is_xsd_type?(klass) klass.ancestors.include?(XSD::NSDBase) end |
#qualified_type_name ⇒ Object
419 420 421 422 423 424 425 426 |
# File 'lib/action_service/protocol/soap.rb', line 419 def qualified_type_name name = type_name if custom_type? "typens:#{name}" else xsd_type_for(@soap_klass) end end |
#type_name ⇒ Object
411 412 413 |
# File 'lib/action_service/protocol/soap.rb', line 411 def type_name @type_name end |
#xsd_type_for(klass) ⇒ Object
442 443 444 445 446 447 448 |
# File 'lib/action_service/protocol/soap.rb', line 442 def xsd_type_for(klass) ns = XSD::NS.new ns.assign(XSD::Namespace, SOAP::XSDNamespaceTag) xsd_klass = klass.ancestors.find{|c| c.const_defined?('Type')} return ns.name(XSD::AnyTypeName) unless xsd_klass ns.name(xsd_klass.const_get('Type')) end |