Class: PAPI::Component

Inherits:
Object
  • Object
show all
Defined in:
lib/PAPI/Component.rb

Defined Under Namespace

Classes: Info

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(info, idx = 0) ⇒ Component

Returns a new instance of Component.



56
57
58
59
# File 'lib/PAPI/Component.rb', line 56

def initialize(info, idx = 0)
  @info = info
  @idx = idx
end

Instance Attribute Details

#infoObject (readonly)

Returns the value of attribute info.



52
53
54
# File 'lib/PAPI/Component.rb', line 52

def info
  @info
end

#nativeObject

Returns the value of attribute native.



53
54
55
# File 'lib/PAPI/Component.rb', line 53

def native
  @native
end

#presetObject

Returns the value of attribute preset.



54
55
56
# File 'lib/PAPI/Component.rb', line 54

def preset
  @preset
end

Instance Method Details

#to_iObject



61
62
63
# File 'lib/PAPI/Component.rb', line 61

def to_i
  return @idx
end

#to_sObject



65
66
67
# File 'lib/PAPI/Component.rb', line 65

def to_s
  @info[:name].to_ptr.read_string
end