Class: Minpaso::SearchResultPager::Item

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(elt) ⇒ Item

Returns a new instance of Item.



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/minpaso.rb', line 62

def initialize(elt)
  elt.elements.each do |e|
    case e.name
    when "ItemId"; @id = e.text.to_i
    when "Manufacture"; @manufacture = e.text
    when "ProductName"; @product_name = e.text
    when "WeiScore"; @wei_score = e.text.to_f
    when "CpuScore"; @cpu_score = e.text.to_f
    when "MemoryScore"; @memory_score = e.text.to_f
    when "VideoScore"; @video_score = e.text.to_f
    when "GameScore"; @game_score = e.text.to_f
    when "HddScore"; @hdd_score = e.text.to_f
    when "TotalScore"; @total_score = e.text.to_f
    end
  end
end

Instance Attribute Details

#cpu_scoreObject (readonly)

Returns the value of attribute cpu_score.



58
59
60
# File 'lib/minpaso.rb', line 58

def cpu_score
  @cpu_score
end

#game_scoreObject (readonly)

Returns the value of attribute game_score.



59
60
61
# File 'lib/minpaso.rb', line 59

def game_score
  @game_score
end

#hdd_scoreObject (readonly)

Returns the value of attribute hdd_score.



59
60
61
# File 'lib/minpaso.rb', line 59

def hdd_score
  @hdd_score
end

#idObject (readonly)

Returns the value of attribute id.



58
59
60
# File 'lib/minpaso.rb', line 58

def id
  @id
end

#manufactureObject (readonly)

Returns the value of attribute manufacture.



58
59
60
# File 'lib/minpaso.rb', line 58

def manufacture
  @manufacture
end

#memory_scoreObject (readonly)

Returns the value of attribute memory_score.



59
60
61
# File 'lib/minpaso.rb', line 59

def memory_score
  @memory_score
end

#product_nameObject (readonly)

Returns the value of attribute product_name.



58
59
60
# File 'lib/minpaso.rb', line 58

def product_name
  @product_name
end

#total_scoreObject (readonly)

Returns the value of attribute total_score.



60
61
62
# File 'lib/minpaso.rb', line 60

def total_score
  @total_score
end

#video_scoreObject (readonly)

Returns the value of attribute video_score.



59
60
61
# File 'lib/minpaso.rb', line 59

def video_score
  @video_score
end

#wei_scoreObject (readonly)

Returns the value of attribute wei_score.



58
59
60
# File 'lib/minpaso.rb', line 58

def wei_score
  @wei_score
end

Instance Method Details

#pcinfo(guess_score = true) ⇒ Object

Qeury the PC detail informations.



80
81
82
# File 'lib/minpaso.rb', line 80

def pcinfo(guess_score = true)
  Minpaso::PCInfo.new(@id, guess_score)
end