Class: PlaylyfeClient::V2::Game
- Defined in:
- lib/playlyfe_client/v2/game.rb
Overview
Game is 1:1 to connection, so only one instance per connection finding is done by credentials
Instance Attribute Summary collapse
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#game_hash ⇒ Object
readonly
Returns the value of attribute game_hash.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#ignore_rate_limit_errors ⇒ Object
Returns the value of attribute ignore_rate_limit_errors.
-
#timezone ⇒ Object
readonly
Returns the value of attribute timezone.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Attributes inherited from Game
Class Method Summary collapse
Instance Method Summary collapse
- #actions ⇒ Object
- #available_actions ⇒ Object
-
#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.
- #image_data(style = :original) ⇒ Object
- #leaderboards ⇒ Object
- #metrics ⇒ Object
- #players ⇒ Object
- #teams ⇒ Object
Methods inherited from Game
Instance Attribute Details
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
17 18 19 |
# File 'lib/playlyfe_client/v2/game.rb', line 17 def created_at @created_at end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
17 18 19 |
# File 'lib/playlyfe_client/v2/game.rb', line 17 def description @description end |
#game_hash ⇒ Object (readonly)
Returns the value of attribute game_hash.
17 18 19 |
# File 'lib/playlyfe_client/v2/game.rb', line 17 def game_hash @game_hash end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
17 18 19 |
# File 'lib/playlyfe_client/v2/game.rb', line 17 def id @id end |
#ignore_rate_limit_errors ⇒ Object
Returns the value of attribute ignore_rate_limit_errors.
18 19 20 |
# File 'lib/playlyfe_client/v2/game.rb', line 18 def ignore_rate_limit_errors @ignore_rate_limit_errors end |
#timezone ⇒ Object (readonly)
Returns the value of attribute timezone.
17 18 19 |
# File 'lib/playlyfe_client/v2/game.rb', line 17 def timezone @timezone end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
17 18 19 |
# File 'lib/playlyfe_client/v2/game.rb', line 17 def type @type end |
Class Method Details
.find_by_connection(conn) ⇒ Object
20 21 22 |
# File 'lib/playlyfe_client/v2/game.rb', line 20 def self.find_by_connection(conn) PlaylyfeClient::V2::Game.new(conn) end |
Instance Method Details
#actions ⇒ Object
36 37 38 |
# File 'lib/playlyfe_client/v2/game.rb', line 36 def actions @actions ||= PlaylyfeClient::V2::ActionCollection.new(self) end |
#available_actions ⇒ Object
40 41 42 |
# File 'lib/playlyfe_client/v2/game.rb', line 40 def available_actions actions end |
#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
54 55 56 57 58 59 60 |
# File 'lib/playlyfe_client/v2/game.rb', line 54 def events(start_time=nil,end_time=nil) if start_time.nil? @events ||= PlaylyfeClient::V2::EventCollection.new(self) else PlaylyfeClient::V2::EventCollection.new(self, self.connection.get_game_events_array(start_time, end_time)) end end |
#image_data(style = :original) ⇒ Object
48 49 50 51 |
# File 'lib/playlyfe_client/v2/game.rb', line 48 def image_data(style=:original) data=connection.get_game_image_data puts(data) end |
#leaderboards ⇒ Object
44 45 46 |
# File 'lib/playlyfe_client/v2/game.rb', line 44 def leaderboards @leaderboards ||= PlaylyfeClient::V2::LeaderboardCollection.new(self) end |
#metrics ⇒ Object
32 33 34 |
# File 'lib/playlyfe_client/v2/game.rb', line 32 def metrics @metrics ||= PlaylyfeClient::V2::MetricCollection.new(self) end |
#players ⇒ Object
24 25 26 |
# File 'lib/playlyfe_client/v2/game.rb', line 24 def players @players ||= PlaylyfeClient::V2::PlayerCollection.new(self) end |
#teams ⇒ Object
28 29 30 |
# File 'lib/playlyfe_client/v2/game.rb', line 28 def teams @teams ||= PlaylyfeClient::V2::TeamCollection.new(self) end |