Class: TF2GoldenWrench
- Inherits:
-
Object
- Object
- TF2GoldenWrench
- Defined in:
- lib/steam/community/tf2/tf2_golden_wrench.rb
Overview
Represents the special Team Fortress 2 item Golden Wrench. It includes the ID of the item, the serial number of the wrench, a reference to the SteamId of the owner and the date this player crafted the wrench
Constant Summary collapse
- @@golden_wrenches =
nil
Instance Attribute Summary collapse
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#owner ⇒ Object
readonly
Returns the value of attribute owner.
Class Method Summary collapse
-
.golden_wrenches ⇒ Object
Returns an array of all golden wrenches (as instances of TF2GoldenWrench).
Instance Attribute Details
#date ⇒ Object (readonly)
Returns the value of attribute date.
15 16 17 |
# File 'lib/steam/community/tf2/tf2_golden_wrench.rb', line 15 def date @date end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
15 16 17 |
# File 'lib/steam/community/tf2/tf2_golden_wrench.rb', line 15 def id @id end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
15 16 17 |
# File 'lib/steam/community/tf2/tf2_golden_wrench.rb', line 15 def number @number end |
#owner ⇒ Object (readonly)
Returns the value of attribute owner.
15 16 17 |
# File 'lib/steam/community/tf2/tf2_golden_wrench.rb', line 15 def owner @owner end |
Class Method Details
.golden_wrenches ⇒ Object
Returns an array of all golden wrenches (as instances of TF2GoldenWrench)
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/steam/community/tf2/tf2_golden_wrench.rb', line 20 def self.golden_wrenches if @@golden_wrenches.nil? @@golden_wrenches = [] data = JSON.parse(WebApi.json('ITFItems_440', 'GetGoldenWrenches'), { :symbolize_names => true }) data[:results][:wrenches][:wrench].each do |wrench_data| @@golden_wrenches << TF2GoldenWrench.new(wrench_data) end end @@golden_wrenches end |