Class: PUBG::Match::Roster::Relationships

Inherits:
Object
  • Object
show all
Defined in:
lib/pubg/match/roster/relationships.rb

Defined Under Namespace

Classes: Participants

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Relationships

Returns a new instance of Relationships.



7
8
9
10
11
12
# File 'lib/pubg/match/roster/relationships.rb', line 7

def initialize(args)
  @args = args
  @team = args["team"]["data"]
  @participants = Array.new
  get_participants
end

Instance Attribute Details

#participantsObject (readonly)

Returns the value of attribute participants.



5
6
7
# File 'lib/pubg/match/roster/relationships.rb', line 5

def participants
  @participants
end

#teamObject (readonly)

Returns the value of attribute team.



5
6
7
# File 'lib/pubg/match/roster/relationships.rb', line 5

def team
  @team
end

Instance Method Details

#get_participantsObject



14
15
16
17
18
# File 'lib/pubg/match/roster/relationships.rb', line 14

def get_participants
  @args["participants"]["data"].each do |participant|
    @participants << Participants.new(participant)
  end
end