class Flox::Score
Provides information about the value and origin of one posted score entry.
Attributes
country[R]
@return [String] the country from which the score originated, in a
two-letter country code.
created_at[R]
@return [Time] the date at which the score was posted.
player_id[R]
@return [String] the ID of the player who posted the score.
Note that this could be a guest player unknown to the server.
player_name[R]
@return [String] the name of the player who posted the score.
value[R]
@return [Fixnum] the actual score.
Public Class Methods
new(data)
click to toggle source
@param data [Hash] the contents of the score as given by the Flox
server.
# File lib/flox/score.rb, line 26 def initialize(data) @player_id = data[:playerId].to_s @player_name = data[:playerName].to_s @value = data[:value].to_i @country = data[:country].to_s @created_at = Time.parse(data[:createdAt].to_s) end