Class: CIM::Method
- Inherits:
-
ClassFeature
- Object
- NamedElement
- ClassFeature
- CIM::Method
- Defined in:
- lib/cim/method.rb
Overview
A Method defines a function member of a Class.
For data members, see Property.
Instance Attribute Summary
Attributes inherited from ClassFeature
Attributes inherited from NamedElement
Instance Method Summary collapse
-
#initialize(type, name, qualifiers = nil, parameters = nil) ⇒ Method
constructor
Create a Method with return type (Type) and name (String), optional Qualifiers and parameters (Property).
-
#method? ⇒ Boolean
Makes a Method recognizable in the set of Class features.
-
#parameters ⇒ Object
parameters accessor.
-
#to_s ⇒ Object
returns a string representation in MOF syntax format.
Methods inherited from ClassFeature
#key?, #property?, #reference?, #static?
Methods inherited from NamedElement
Constructor Details
#initialize(type, name, qualifiers = nil, parameters = nil) ⇒ Method
25 26 27 28 |
# File 'lib/cim/method.rb', line 25 def initialize type, name, qualifiers = nil, parameters = nil @parameters = parameters super type,name,qualifiers end |
Instance Method Details
#method? ⇒ Boolean
Makes a Method recognizable in the set of Class features.
38 39 40 |
# File 'lib/cim/method.rb', line 38 def method? true end |
#parameters ⇒ Object
parameters accessor
32 33 34 |
# File 'lib/cim/method.rb', line 32 def parameters @parameters || [] end |
#to_s ⇒ Object
returns a string representation in MOF syntax format
44 45 46 47 |
# File 'lib/cim/method.rb', line 44 def to_s p = parameters.join(", ") "#{super}(#{p})" end |