Class: BackpackTF::User
Constant Summary collapse
- INTERFACE =
:IGetUsers- @@players =
{}
Instance Attribute Summary collapse
-
#backpack_tf_banned ⇒ Object
readonly
Returns the value of attribute backpack_tf_banned.
-
#backpack_tf_group ⇒ Object
readonly
Returns the value of attribute backpack_tf_group.
-
#backpack_tf_reputation ⇒ Object
readonly
Returns the value of attribute backpack_tf_reputation.
-
#backpack_tf_trust ⇒ Object
readonly
Returns the value of attribute backpack_tf_trust.
-
#backpack_update ⇒ Object
readonly
Returns the value of attribute backpack_update.
-
#backpack_value ⇒ Object
readonly
Returns the value of attribute backpack_value.
-
#ban_community ⇒ Object
readonly
Returns the value of attribute ban_community.
-
#ban_economy ⇒ Object
readonly
Returns the value of attribute ban_economy.
-
#ban_vac ⇒ Object
readonly
Returns the value of attribute ban_vac.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#notifications ⇒ Object
readonly
Returns the value of attribute notifications.
-
#steamid ⇒ Object
readonly
Returns the value of attribute steamid.
-
#steamrep_scammer ⇒ Object
readonly
Returns the value of attribute steamrep_scammer.
-
#success ⇒ Object
readonly
Returns the value of attribute success.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attr) ⇒ User
constructor
A new instance of User.
Methods inherited from Response
hash_keys_to_sym, interface, responses, to_sym
Constructor Details
#initialize(attr) ⇒ User
Returns a new instance of User.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/backpack_tf/user.rb', line 35 def initialize attr attr = check_attr_keys(attr) @steamid = attr[:steamid] @success = attr[:success] @backpack_value = attr[:backpack_value] @backpack_update = attr[:backpack_update] @name = attr[:name] @backpack_tf_reputation = attr[:backpack_tf_reputation] @backpack_tf_group = attr[:backpack_tf_group] @backpack_tf_banned = attr[:backpack_tf_banned] @backpack_tf_trust = attr[:backpack_tf_trust] @steamrep_scammer = attr[:steamrep_scammer] @ban_economy = attr[:ban_economy] @ban_community = attr[:ban_community] @ban_vac = attr[:ban_vac] @notifications = attr[:notifications] end |
Instance Attribute Details
#backpack_tf_banned ⇒ Object (readonly)
Returns the value of attribute backpack_tf_banned.
27 28 29 |
# File 'lib/backpack_tf/user.rb', line 27 def backpack_tf_banned @backpack_tf_banned end |
#backpack_tf_group ⇒ Object (readonly)
Returns the value of attribute backpack_tf_group.
26 27 28 |
# File 'lib/backpack_tf/user.rb', line 26 def backpack_tf_group @backpack_tf_group end |
#backpack_tf_reputation ⇒ Object (readonly)
Returns the value of attribute backpack_tf_reputation.
25 26 27 |
# File 'lib/backpack_tf/user.rb', line 25 def backpack_tf_reputation @backpack_tf_reputation end |
#backpack_tf_trust ⇒ Object (readonly)
Returns the value of attribute backpack_tf_trust.
28 29 30 |
# File 'lib/backpack_tf/user.rb', line 28 def backpack_tf_trust @backpack_tf_trust end |
#backpack_update ⇒ Object (readonly)
Returns the value of attribute backpack_update.
23 24 25 |
# File 'lib/backpack_tf/user.rb', line 23 def backpack_update @backpack_update end |
#backpack_value ⇒ Object (readonly)
Returns the value of attribute backpack_value.
22 23 24 |
# File 'lib/backpack_tf/user.rb', line 22 def backpack_value @backpack_value end |
#ban_community ⇒ Object (readonly)
Returns the value of attribute ban_community.
31 32 33 |
# File 'lib/backpack_tf/user.rb', line 31 def ban_community @ban_community end |
#ban_economy ⇒ Object (readonly)
Returns the value of attribute ban_economy.
30 31 32 |
# File 'lib/backpack_tf/user.rb', line 30 def ban_economy @ban_economy end |
#ban_vac ⇒ Object (readonly)
Returns the value of attribute ban_vac.
32 33 34 |
# File 'lib/backpack_tf/user.rb', line 32 def ban_vac @ban_vac end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
24 25 26 |
# File 'lib/backpack_tf/user.rb', line 24 def name @name end |
#notifications ⇒ Object (readonly)
Returns the value of attribute notifications.
33 34 35 |
# File 'lib/backpack_tf/user.rb', line 33 def notifications @notifications end |
#steamid ⇒ Object (readonly)
Returns the value of attribute steamid.
20 21 22 |
# File 'lib/backpack_tf/user.rb', line 20 def steamid @steamid end |
#steamrep_scammer ⇒ Object (readonly)
Returns the value of attribute steamrep_scammer.
29 30 31 |
# File 'lib/backpack_tf/user.rb', line 29 def steamrep_scammer @steamrep_scammer end |
#success ⇒ Object (readonly)
Returns the value of attribute success.
21 22 23 |
# File 'lib/backpack_tf/user.rb', line 21 def success @success end |
Class Method Details
.players ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/backpack_tf/user.rb', line 12 def self.players return @response if response.nil? @@players = response[:players].inject({}) do |players, (steamid, attr)| players[steamid] = new(attr) players end end |
.response ⇒ Object
8 9 10 |
# File 'lib/backpack_tf/user.rb', line 8 def self.response @response = superclass.responses[to_sym] end |