Class: WSDL::Parser::Service Private
- Inherits:
-
Object
- Object
- WSDL::Parser::Service
- Defined in:
- lib/wsdl/parser/service.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Represents a WSDL service element.
A service groups a set of related ports together. Each port defines a single endpoint that combines a binding with a network address. Services are the top-level entry point for discovering available endpoints in a WSDL document.
Instance Method Summary collapse
-
#initialize(service_node) ⇒ Service
constructor
private
Creates a new Service from a WSDL service XML node.
-
#name ⇒ String
private
Returns the name of this service.
-
#ports ⇒ Hash{String => Port}
private
Returns the ports defined in this service.
-
#to_hash ⇒ Hash
private
Converts this service to a Hash representation.
Constructor Details
#initialize(service_node) ⇒ Service
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Creates a new Service from a WSDL service XML node.
18 19 20 |
# File 'lib/wsdl/parser/service.rb', line 18 def initialize(service_node) @service_node = service_node end |
Instance Method Details
#name ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the name of this service.
25 26 27 |
# File 'lib/wsdl/parser/service.rb', line 25 def name @service_node['name'] end |
#ports ⇒ Hash{String => Port}
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the ports defined in this service.
32 33 34 |
# File 'lib/wsdl/parser/service.rb', line 32 def ports @ports ||= ports! end |
#to_hash ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Converts this service to a Hash representation.
47 48 49 50 |
# File 'lib/wsdl/parser/service.rb', line 47 def to_hash port_hash = ports.values.inject({}) { |memo, port| memo.merge port.to_hash } { name => { ports: port_hash } } end |