Class: SRL::Player

Inherits:
Object
  • Object
show all
Includes:
Unmarshalable
Defined in:
lib/srl/player.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.



20
21
22
# File 'lib/srl/player.rb', line 20

def api
  @api
end

#channelObject (readonly)

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



17
18
19
# File 'lib/srl/player.rb', line 17

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.



11
12
13
# File 'lib/srl/player.rb', line 11

def name
  @name
end

#oidObject (readonly) Also known as: player_id

Returns the value of attribute oid.



6
7
8
# File 'lib/srl/player.rb', line 6

def oid
  @oid
end

#twitterObject (readonly)

This player’s Twitter name.



29
30
31
# File 'lib/srl/player.rb', line 29

def twitter
  @twitter
end

#youtubeObject (readonly)

This player’s YouTube channel.



26
27
28
# File 'lib/srl/player.rb', line 26

def youtube
  @youtube
end

Instance Method Details

#exists?Boolean

Does this player exist?

Returns:

  • (Boolean)


40
41
42
# File 'lib/srl/player.rb', line 40

def exists?
  player_id != 0
end

#streamObject

URL to this player’s stream.

FIXME

Add support for non-twitch streams.



34
35
36
37
# File 'lib/srl/player.rb', line 34

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