Class: RLS::Platform

Inherits:
Object
  • Object
show all
Defined in:
lib/rls/objects/platform.rb

Overview

A gaming platform that is tracked by RLS. These change very rarely, and constants to the most common platforms are provided so that users do not have to make an API request.

Constant Summary collapse

Steam =
Platform.new('id' => 1, 'name' => 'Steam')
Ps4 =
Platform.new('id' => 2, 'name' => 'Ps4')
XboxOne =
Platform.new('id' => 3, 'name' => 'XboxOne')

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Platform

Returns a new instance of Platform



14
15
16
17
# File 'lib/rls/objects/platform.rb', line 14

def initialize(data)
  @id = data['id']
  @name = data['name']
end

Instance Attribute Details

#idInteger (readonly)

Returns ID of this platform

Returns:

  • (Integer)

    ID of this platform



9
10
11
# File 'lib/rls/objects/platform.rb', line 9

def id
  @id
end

#nameString (readonly)

Returns name of this platform

Returns:

  • (String)

    name of this platform



12
13
14
# File 'lib/rls/objects/platform.rb', line 12

def name
  @name
end