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 ⇒ Time
readonly
Returns the date this Golden Wrench has been crafted.
-
#id ⇒ Fixnum
readonly
Returns the unique item ID of this Golden Wrench.
-
#number ⇒ Fixnum
readonly
Returns the serial number of this Golden Wrench.
-
#owner ⇒ SteamId
readonly
Returns the SteamID of the owner of this Golden Wrench.
Class Method Summary collapse
-
.golden_wrenches ⇒ Array<GoldenWrench>
Returns all Golden Wrenches.
Instance Attribute Details
#date ⇒ Time (readonly)
Returns the date this Golden Wrench has been crafted
21 22 23 |
# File 'lib/steam/community/tf2/tf2_golden_wrench.rb', line 21 def date @date end |
#id ⇒ Fixnum (readonly)
Returns the unique item ID of this Golden Wrench
26 27 28 |
# File 'lib/steam/community/tf2/tf2_golden_wrench.rb', line 26 def id @id end |
#number ⇒ Fixnum (readonly)
Returns the serial number of this Golden Wrench
31 32 33 |
# File 'lib/steam/community/tf2/tf2_golden_wrench.rb', line 31 def number @number end |
#owner ⇒ SteamId (readonly)
Returns the SteamID of the owner of this Golden Wrench
36 37 38 |
# File 'lib/steam/community/tf2/tf2_golden_wrench.rb', line 36 def owner @owner end |
Class Method Details
.golden_wrenches ⇒ Array<GoldenWrench>
Returns all Golden Wrenches
45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/steam/community/tf2/tf2_golden_wrench.rb', line 45 def self.golden_wrenches if @@golden_wrenches.nil? @@golden_wrenches = [] data = MultiJson.load(WebApi.json('ITFItems_440', 'GetGoldenWrenches', 2), { :symbolize_keys => true }) data[:results][:wrenches].each do |wrench_data| @@golden_wrenches << TF2GoldenWrench.new(wrench_data) end end @@golden_wrenches end |