Class: Copland::ServiceModel::AbstractServiceModel

Inherits:
Object
  • Object
show all
Defined in:
lib/copland/models/abstract.rb

Overview

This is the parent class of all service model implementations.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(service_point) ⇒ AbstractServiceModel

Create a new service model around the given service point.



55
56
57
# File 'lib/copland/models/abstract.rb', line 55

def initialize( service_point )
  @service_point = service_point
end

Instance Attribute Details

#service_pointObject (readonly)

This is the service point that this model protects.



52
53
54
# File 'lib/copland/models/abstract.rb', line 52

def service_point
  @service_point
end

Class Method Details

.register_as(name) ⇒ Object

A convenience method for allowing subclasses to register themselves with the ClassFactory.



66
67
68
69
70
71
72
73
# File 'lib/copland/models/abstract.rb', line 66

def self.register_as( name )
  class_eval "    def name\n      \#{name.inspect}\n    end\n  EOF\n  Copland::ClassFactory.instance.register( POOL_NAME, name, self )\nend\n"

Instance Method Details

#instance(&block) ⇒ Object

Raises a NotImplementedException. Subclasses must override this method.

Raises:

  • (NotImplementedException)


60
61
62
# File 'lib/copland/models/abstract.rb', line 60

def instance( &block )
  raise NotImplementedException
end