Class: Dribble::Player
Instance Attribute Summary collapse
-
#avatar_url ⇒ Object
readonly
Returns the value of attribute avatar_url.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#drafted_by_player_id ⇒ Object
readonly
Returns the value of attribute drafted_by_player_id.
-
#draftees_count ⇒ Object
readonly
Returns the value of attribute draftees_count.
-
#followers_count ⇒ Object
readonly
Returns the value of attribute followers_count.
-
#following(options = {}) ⇒ Array
readonly
Following.
-
#following_count ⇒ Object
readonly
Returns the value of attribute following_count.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#shots(options = {}) ⇒ Array
readonly
Player’s Shots.
-
#shots_count ⇒ Object
readonly
Returns the value of attribute shots_count.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Class Method Summary collapse
-
.find_shots(id, options = {}) ⇒ Object
Find shots for a given player.
-
.following_shots(id, options = {}) ⇒ Object
Following Shots.
-
.profile(id) ⇒ Object
(also: find)
Profile.
Instance Method Summary collapse
-
#initialize(attr = {}) ⇒ Player
constructor
A new instance of Player.
Constructor Details
#initialize(attr = {}) ⇒ Player
Returns a new instance of Player.
8 9 10 11 12 |
# File 'lib/dribble/player.rb', line 8 def initialize(attr={}) attr.each do |key, value| instance_variable_set("@#{key}", value) end end |
Instance Attribute Details
#avatar_url ⇒ Object (readonly)
Returns the value of attribute avatar_url.
3 4 5 |
# File 'lib/dribble/player.rb', line 3 def avatar_url @avatar_url end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
3 4 5 |
# File 'lib/dribble/player.rb', line 3 def created_at @created_at end |
#drafted_by_player_id ⇒ Object (readonly)
Returns the value of attribute drafted_by_player_id.
3 4 5 |
# File 'lib/dribble/player.rb', line 3 def drafted_by_player_id @drafted_by_player_id end |
#draftees_count ⇒ Object (readonly)
Returns the value of attribute draftees_count.
3 4 5 |
# File 'lib/dribble/player.rb', line 3 def draftees_count @draftees_count end |
#followers_count ⇒ Object (readonly)
Returns the value of attribute followers_count.
3 4 5 |
# File 'lib/dribble/player.rb', line 3 def followers_count @followers_count end |
#following(options = {}) ⇒ Array (readonly)
Following
22 23 24 |
# File 'lib/dribble/player.rb', line 22 def following @following end |
#following_count ⇒ Object (readonly)
Returns the value of attribute following_count.
3 4 5 |
# File 'lib/dribble/player.rb', line 3 def following_count @following_count end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/dribble/player.rb', line 3 def id @id end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
3 4 5 |
# File 'lib/dribble/player.rb', line 3 def location @location end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/dribble/player.rb', line 3 def name @name end |
#shots(options = {}) ⇒ Array (readonly)
Player’s Shots
34 35 36 |
# File 'lib/dribble/player.rb', line 34 def shots @shots end |
#shots_count ⇒ Object (readonly)
Returns the value of attribute shots_count.
3 4 5 |
# File 'lib/dribble/player.rb', line 3 def shots_count @shots_count end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
3 4 5 |
# File 'lib/dribble/player.rb', line 3 def url @url end |
Class Method Details
.find_shots(id, options = {}) ⇒ Object
Find shots for a given player
49 50 51 52 |
# File 'lib/dribble/player.rb', line 49 def find_shots(id, ={}) results = Dribble::API::Player.find_shots(id, ) Dribble::Shots.new(format_shots(results), results) end |