Class: WBEM::CIMType

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/wbem/cim_types.rb

Direct Known Subclasses

Boolean, CIMFloat, CIMInt

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cimtype, value) ⇒ CIMType

Returns a new instance of CIMType.



33
34
35
36
# File 'lib/wbem/cim_types.rb', line 33

def initialize(cimtype, value) 
    @cimtype = cimtype
    @value = value
end

Instance Attribute Details

#cimtypeObject

“”“Base type for all CIM types.”“”



31
32
33
# File 'lib/wbem/cim_types.rb', line 31

def cimtype
  @cimtype
end

#valueObject

“”“Base type for all CIM types.”“”



31
32
33
# File 'lib/wbem/cim_types.rb', line 31

def value
  @value
end

Instance Method Details

#<=>(obj) ⇒ Object



40
41
42
43
44
45
46
# File 'lib/wbem/cim_types.rb', line 40

def <=>(obj)
    if obj.is_a?(CIMType)
        @value <=> obj.value
    else
        @value <=> obj
    end
end

#to_sObject



37
38
39
# File 'lib/wbem/cim_types.rb', line 37

def to_s
    @value.to_s
end