Class: SRL::Player

Inherits:
Object
  • Object
show all
Includes:
Unmarshalable
Defined in:
lib/srl/typedefs.rb

Overview

A registered user of SpeedRunsLive.com

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Unmarshalable

included

Instance Attribute Details

#apiObject

Streaming platform used by this player. For example: Twitch.



272
273
274
# File 'lib/srl/typedefs.rb', line 272

def api
  @api
end

#channelObject (readonly)

– Stream information for the player ++ This player’s profile name on a streaming service.



269
270
271
# File 'lib/srl/typedefs.rb', line 269

def channel
  @channel
end

#nameObject (readonly)

This player’s registered name on SpeedRunsLive.

NOTE

This might not be the same name that he has registered on IRC.



263
264
265
# File 'lib/srl/typedefs.rb', line 263

def name
  @name
end

#oidObject (readonly) Also known as: player_id

Returns the value of attribute oid.



258
259
260
# File 'lib/srl/typedefs.rb', line 258

def oid
  @oid
end

#twitterObject (readonly)

This player’s Twitter name.



281
282
283
# File 'lib/srl/typedefs.rb', line 281

def twitter
  @twitter
end

#youtubeObject (readonly)

This player’s YouTube channel.



278
279
280
# File 'lib/srl/typedefs.rb', line 278

def youtube
  @youtube
end

Instance Method Details

#exists?Boolean

Does this player exist?

Returns:

  • (Boolean)


292
293
294
# File 'lib/srl/typedefs.rb', line 292

def exists?
  player_id != 0
end

#streamObject

URL to this player’s stream.

FIXME

Add support for non-twitch streams.



286
287
288
289
# File 'lib/srl/typedefs.rb', line 286

def stream
  api == :twitch ? "https://twitch.tv/#{channel}/"
                 : 'Unsupported'
end