Class: Steam::Id::Struct
- Inherits:
-
Object
- Object
- Steam::Id::Struct
- Defined in:
- lib/steam/id/struct.rb
Overview
The internal datastructure of a steamid. A 64 bit integer
Constant Summary collapse
- ACCOUNT_ID_MASK =
The bit mask applied to get the account id
0xFFFFFFFF- INSTANCE_MASK =
The bit mask applied to get the instance mask
0xFFFFF- UNIVERSE_MASK =
The bit mask applied to get the universe mask
0xFF- ACCOUNT_TYPE_MASK =
The bit mask applied to get the account type
0xF
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#account_id ⇒ Integer
Gets the account id.
-
#account_id=(value) ⇒ Integer
Sets the account_id.
-
#account_type ⇒ Integer
Gets the account type.
-
#account_type=(value) ⇒ Object
Sets the account type.
-
#initialize(data = 0) ⇒ Struct
constructor
A new instance of Struct.
-
#instance ⇒ Integer
Gets the instance.
-
#instance=(value) ⇒ Object
Sets the instance.
-
#to_i ⇒ Object
Returns the internal integer.
-
#universe ⇒ Integer
Gets the universe.
-
#universe=(value) ⇒ Object
Sets the universe.
Constructor Details
#initialize(data = 0) ⇒ Struct
Returns a new instance of Struct.
19 20 21 |
# File 'lib/steam/id/struct.rb', line 19 def initialize(data = 0) @data = data.to_i end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
5 6 7 |
# File 'lib/steam/id/struct.rb', line 5 def data @data end |
Instance Method Details
#account_id ⇒ Integer
Gets the account id
31 32 33 |
# File 'lib/steam/id/struct.rb', line 31 def account_id get(0, ACCOUNT_ID_MASK) end |
#account_id=(value) ⇒ Integer
Sets the account_id
38 39 40 |
# File 'lib/steam/id/struct.rb', line 38 def account_id=(value) set(0, ACCOUNT_ID_MASK, value) end |
#account_type ⇒ Integer
Gets the account type
57 58 59 |
# File 'lib/steam/id/struct.rb', line 57 def account_type get(52, ACCOUNT_TYPE_MASK) end |
#account_type=(value) ⇒ Object
Sets the account type
62 63 64 |
# File 'lib/steam/id/struct.rb', line 62 def account_type=(value) set(52, ACCOUNT_TYPE_MASK, value) end |
#instance ⇒ Integer
Gets the instance
45 46 47 |
# File 'lib/steam/id/struct.rb', line 45 def instance get(32, INSTANCE_MASK) end |
#instance=(value) ⇒ Object
Sets the instance
50 51 52 |
# File 'lib/steam/id/struct.rb', line 50 def instance=(value) set(32, INSTANCE_MASK, value) end |
#to_i ⇒ Object
Returns the internal integer
24 25 26 |
# File 'lib/steam/id/struct.rb', line 24 def to_i @data.to_i end |
#universe ⇒ Integer
Gets the universe
69 70 71 |
# File 'lib/steam/id/struct.rb', line 69 def universe get(56, UNIVERSE_MASK) end |
#universe=(value) ⇒ Object
Sets the universe
74 75 76 |
# File 'lib/steam/id/struct.rb', line 74 def universe=(value) set(56, UNIVERSE_MASK, value) end |