Class: Minpaso::PCInfo
- Inherits:
-
Object
- Object
- Minpaso::PCInfo
- Defined in:
- lib/minpaso.rb
Overview
PCInfo shows PC detail informations.
Defined Under Namespace
Classes: CPU, Graphics, HDD, Memory, System
Instance Attribute Summary collapse
-
#cpu ⇒ Object
readonly
Returns the value of attribute cpu.
-
#graphics ⇒ Object
readonly
Returns the value of attribute graphics.
-
#guess_score ⇒ Object
readonly
Returns the value of attribute guess_score.
-
#hdd ⇒ Object
readonly
Returns the value of attribute hdd.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#memory ⇒ Object
readonly
Returns the value of attribute memory.
-
#system ⇒ Object
readonly
Returns the value of attribute system.
Instance Method Summary collapse
-
#initialize(id, guess_score = true) ⇒ PCInfo
constructor
A new instance of PCInfo.
Constructor Details
#initialize(id, guess_score = true) ⇒ PCInfo
Returns a new instance of PCInfo.
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
# File 'lib/minpaso.rb', line 122 def initialize(id, guess_score = true) @id = id @guess_score = guess_score uri = URI.parse("http://minpaso.goga.co.jp/api/pc.php?id=#{@id.to_s}&e=#{guess_score}") doc = REXML::Document.new(uri.read) doc.root.elements.each do |elt| case elt.name when "System"; @system = System.new(elt) when "Cpu"; @cpu = CPU.new(elt) when "Graphics"; @graphics = Graphics.new(elt) when "Memory"; @memory = Memory.new(elt) when "Hdd"; @hdd = HDD.new(elt) end end end |
Instance Attribute Details
#cpu ⇒ Object (readonly)
Returns the value of attribute cpu.
120 121 122 |
# File 'lib/minpaso.rb', line 120 def cpu @cpu end |
#graphics ⇒ Object (readonly)
Returns the value of attribute graphics.
120 121 122 |
# File 'lib/minpaso.rb', line 120 def graphics @graphics end |
#guess_score ⇒ Object (readonly)
Returns the value of attribute guess_score.
120 121 122 |
# File 'lib/minpaso.rb', line 120 def guess_score @guess_score end |
#hdd ⇒ Object (readonly)
Returns the value of attribute hdd.
120 121 122 |
# File 'lib/minpaso.rb', line 120 def hdd @hdd end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
120 121 122 |
# File 'lib/minpaso.rb', line 120 def id @id end |
#memory ⇒ Object (readonly)
Returns the value of attribute memory.
120 121 122 |
# File 'lib/minpaso.rb', line 120 def memory @memory end |
#system ⇒ Object (readonly)
Returns the value of attribute system.
120 121 122 |
# File 'lib/minpaso.rb', line 120 def system @system end |