Class: Genprovider::Registration

Inherits:
Object
  • Object
show all
Defined in:
lib/genprovider/registration.rb

Instance Method Summary collapse

Constructor Details

#initialize(c, namespace, providername, out) ⇒ Registration

Returns a new instance of Registration.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/genprovider/registration.rb', line 7

def initialize c, namespace, providername, out
  out.comment.comment "Registration for provider #{providername} of class #{c.class}"
  out.comment.comment "Generated by 'genprovider' for use with cmpi-bindings-ruby"
  out.comment.comment "Classname - Namespace - Providername - Libraryname - Capabilities ..."

  mask = Genprovider.classmask c
  capabilities = ""
  if (mask & ASSOCIATION_MASK) != 0
    capabilities << " association"
    # an association provider is also an instance provider
    mask |= INSTANCE_MASK
  end
  capabilities << " instance" if (mask & INSTANCE_MASK) != 0
  capabilities << " method" if (mask & METHOD_MASK) != 0
  capabilities << " indication" if (mask & INDICATION_MASK) != 0

  out.puts "#{c.name} #{namespace} #{providername} rbCmpiProvider#{capabilities}"
end