Class: Uddi4r::Model

Inherits:
Object
  • Object
show all
Includes:
ROXML
Defined in:
lib/uddi4r/models.rb

Overview

UDDI models are first-class Ruby objects that represent UDDI data structures. For more information about UDDI data structures, see: uddi.org/pubs/DataStructure-V2.03-Published-20020719.htm

These objects are used as arguments and return types for methods in Uddi4r::Client.

The following model objects are available:

  • ServiceInfo

  • BusinessInfo

  • BusinessList

  • ServiceList

  • TModelInstanceInfo

  • BindingTemplate

  • BindingDetail

  • RelatedBusinessesList

  • BusinessService

  • BusinessEntity

  • BusinessDetail

  • KeyedReference

  • OverviewDoc

  • CategoryBag

  • TModel

  • TModelBag

  • TModelDetail

  • TModelList

  • ServiceDetail

  • IdentifierBag

  • DiscoveryURLs

  • FindQualifiers

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize {|_self| ... } ⇒ Model

Yield self if a block is passed.

Yields:

  • (_self)

Yield Parameters:

  • _self (Uddi4r::Model)

    the object that the method was called on



57
58
59
# File 'lib/uddi4r/models.rb', line 57

def initialize()
  yield self if block_given?
end

Class Method Details

.create_from(response) ⇒ Object

Create a UDDI model object from REXML::Element using ROXML.parse(). Handles nil.



49
50
51
52
53
54
# File 'lib/uddi4r/models.rb', line 49

def self.create_from(response)
  return nil unless response
  element = response.elements["*/*/#{self.tag_name()}"]
  return nil unless element
  self.parse(element)
end

.tag_nameObject

Define the default name to be first letter lower-case (UDDI naming convention) So, for example, ServiceInfo becomes serviceInfo



44
45
46
# File 'lib/uddi4r/models.rb', line 44

def self.tag_name
  @tag_name || self.name.to_s.gsub(/.*::/,"").gsub(/^(.)/) { $1.downcase }
end