Class: PlaylyfeClient::V2::Team

Inherits:
Team
  • Object
show all
Defined in:
lib/playlyfe_client/v2/team.rb

Instance Attribute Summary collapse

Attributes inherited from Team

#connection, #created_at, #game, #id, #name

Instance Method Summary collapse

Methods inherited from Team

#template

Instance Attribute Details

#accessObject (readonly)

Returns the value of attribute access.



7
8
9
# File 'lib/playlyfe_client/v2/team.rb', line 7

def access
  @access
end

#definitionObject (readonly)

Returns the value of attribute definition.



7
8
9
# File 'lib/playlyfe_client/v2/team.rb', line 7

def definition
  @definition
end

#game_idObject (readonly)

Returns the value of attribute game_id.



7
8
9
# File 'lib/playlyfe_client/v2/team.rb', line 7

def game_id
  @game_id
end

#ownerObject (readonly)

Returns the value of attribute owner.



7
8
9
# File 'lib/playlyfe_client/v2/team.rb', line 7

def owner
  @owner
end

#rolesObject (readonly)

Returns the value of attribute roles.



7
8
9
# File 'lib/playlyfe_client/v2/team.rb', line 7

def roles
  @roles
end

Instance Method Details

#events(start_time = nil, end_time = nil) ⇒ Object

results are cached if start_time is nil (events for last 24 hours), otherwise direct call to Playlyfe is made



18
19
20
21
22
23
24
# File 'lib/playlyfe_client/v2/team.rb', line 18

def events(start_time=nil,end_time=nil)
  if start_time.nil?
    @events ||= PlaylyfeClient::V2::EventCollection.new(game, game.connection.get_team_events_array(self.id), self)
  else
    PlaylyfeClient::V2::EventCollection.new(game, game.connection.get_team_events_array(self.id,start_time, end_time), self)
  end
end

#leaderboardsObject



13
14
15
# File 'lib/playlyfe_client/v2/team.rb', line 13

def leaderboards
  @game.leaderboards.for_teams
end

#membersObject



9
10
11
# File 'lib/playlyfe_client/v2/team.rb', line 9

def members
  @members ||= fill_members
end