class Steam::Id::Base
Represents a SteamID holds the various parts of the Steam
Id
an internal 64bit datastructure
Attributes
struct[R]
Public Class Methods
new(struct = Struct.new)
click to toggle source
Create a new Steam
ID
# File lib/steam/id/base.rb, line 20 def initialize(struct = Struct.new) @struct = struct end
Public Instance Methods
to_i()
click to toggle source
to_s(klass = Steam2Printer)
click to toggle source
valid?()
click to toggle source
Returns true if the Steam
id is valid
@return [Bool] true if valid, otherwise false
# File lib/steam/id/base.rb, line 44 def valid? valid_universe? && valid_account? end
Private Instance Methods
valid_account?()
click to toggle source
@api private
# File lib/steam/id/base.rb, line 51 def valid_account? return false if account_type <= EAccountType::INVALID || account_type >= EAccountType::MAX if account_type == EAccountType::INDIVIDUAL return false if account_id.zero? end true end
valid_universe?()
click to toggle source
@api private
# File lib/steam/id/base.rb, line 63 def valid_universe? return false if universe <= EUniverse::INVALID || universe >= EUniverse::MAX true end