Class: CPUInfo::CPUS::CPU::CPUFlags
- Inherits:
-
Object
- Object
- CPUInfo::CPUS::CPU::CPUFlags
- Defined in:
- lib/cpuinfo.rb
Instance Attribute Summary collapse
-
#flags ⇒ Object
readonly
Returns the value of attribute flags.
Instance Method Summary collapse
-
#initialize(flagstring) ⇒ CPUFlags
constructor
A new instance of CPUFlags.
- #method_missing(method, *params) ⇒ Object
Constructor Details
#initialize(flagstring) ⇒ CPUFlags
Returns a new instance of CPUFlags.
54 55 56 |
# File 'lib/cpuinfo.rb', line 54 def initialize(flagstring) @flags = flagstring.split(' ') end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *params) ⇒ Object
58 59 60 61 62 |
# File 'lib/cpuinfo.rb', line 58 def method_missing(method, *params) if method[-1] == '?' return @flags.include? method[0..-2] end end |
Instance Attribute Details
#flags ⇒ Object (readonly)
Returns the value of attribute flags.
52 53 54 |
# File 'lib/cpuinfo.rb', line 52 def flags @flags end |