Class: Dribble::Player
Instance Attribute Summary collapse
-
#avatar_url ⇒ Object
readonly
Returns the value of attribute avatar_url.
-
#comments_count ⇒ Object
readonly
Returns the value of attribute comments_count.
-
#comments_received_count ⇒ Object
readonly
Returns the value of attribute comments_received_count.
-
#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 ⇒ Object
readonly
Returns the value of attribute following.
-
#following_count ⇒ Object
readonly
Returns the value of attribute following_count.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#likes_count ⇒ Object
readonly
Returns the value of attribute likes_count.
-
#likes_receive_count ⇒ Object
readonly
Returns the value of attribute likes_receive_count.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#page ⇒ Object
readonly
Returns the value of attribute page.
-
#pages ⇒ Object
readonly
Returns the value of attribute pages.
-
#per_page ⇒ Object
readonly
Returns the value of attribute per_page.
-
#players ⇒ Object
readonly
Returns the value of attribute players.
-
#rebounds_count ⇒ Object
readonly
Returns the value of attribute rebounds_count.
-
#rebounds_received_count ⇒ Object
readonly
Returns the value of attribute rebounds_received_count.
-
#shots(options = {}) ⇒ Array
readonly
Player’s Shots.
-
#shots_count ⇒ Object
readonly
Returns the value of attribute shots_count.
-
#total ⇒ Object
readonly
Returns the value of attribute total.
-
#twitter_screen_name ⇒ Object
readonly
Returns the value of attribute twitter_screen_name.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Class Method Summary collapse
-
.draftees(id, options = {}) ⇒ Object
Draftees.
-
.find_shots(id, options = {}) ⇒ Object
Find shots for a given player.
-
.followers(id, options = {}) ⇒ Object
Followers.
-
.following_shots(id, options = {}) ⇒ Object
Following Shots.
-
.profile(id) ⇒ Object
(also: find)
Profile.
Instance Method Summary collapse
-
#draftees(options = {}) ⇒ Array
Player’s Shots.
-
#followers(options = {}) ⇒ Array
Player’s Shots.
-
#following_shots(options = {}) ⇒ Array
Following shots.
-
#initialize(attr = {}) ⇒ Player
constructor
A new instance of Player.
Constructor Details
#initialize(attr = {}) ⇒ Player
Returns a new instance of Player.
11 12 13 14 15 |
# File 'lib/dribble/player.rb', line 11 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 |
#comments_count ⇒ Object (readonly)
Returns the value of attribute comments_count.
3 4 5 |
# File 'lib/dribble/player.rb', line 3 def comments_count @comments_count end |
#comments_received_count ⇒ Object (readonly)
Returns the value of attribute comments_received_count.
3 4 5 |
# File 'lib/dribble/player.rb', line 3 def comments_received_count @comments_received_count 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 ⇒ Object (readonly)
Returns the value of attribute following.
3 4 5 |
# File 'lib/dribble/player.rb', line 3 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 |
#likes_count ⇒ Object (readonly)
Returns the value of attribute likes_count.
3 4 5 |
# File 'lib/dribble/player.rb', line 3 def likes_count @likes_count end |
#likes_receive_count ⇒ Object (readonly)
Returns the value of attribute likes_receive_count.
3 4 5 |
# File 'lib/dribble/player.rb', line 3 def likes_receive_count @likes_receive_count 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 |
#page ⇒ Object (readonly)
Returns the value of attribute page.
3 4 5 |
# File 'lib/dribble/player.rb', line 3 def page @page end |
#pages ⇒ Object (readonly)
Returns the value of attribute pages.
3 4 5 |
# File 'lib/dribble/player.rb', line 3 def pages @pages end |
#per_page ⇒ Object (readonly)
Returns the value of attribute per_page.
3 4 5 |
# File 'lib/dribble/player.rb', line 3 def per_page @per_page end |
#players ⇒ Object (readonly)
Returns the value of attribute players.
3 4 5 |
# File 'lib/dribble/player.rb', line 3 def players @players end |
#rebounds_count ⇒ Object (readonly)
Returns the value of attribute rebounds_count.
3 4 5 |
# File 'lib/dribble/player.rb', line 3 def rebounds_count @rebounds_count end |
#rebounds_received_count ⇒ Object (readonly)
Returns the value of attribute rebounds_received_count.
3 4 5 |
# File 'lib/dribble/player.rb', line 3 def rebounds_received_count @rebounds_received_count end |
#shots(options = {}) ⇒ Array (readonly)
Player’s Shots
37 38 39 |
# File 'lib/dribble/player.rb', line 37 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 |
#total ⇒ Object (readonly)
Returns the value of attribute total.
3 4 5 |
# File 'lib/dribble/player.rb', line 3 def total @total end |
#twitter_screen_name ⇒ Object (readonly)
Returns the value of attribute twitter_screen_name.
3 4 5 |
# File 'lib/dribble/player.rb', line 3 def twitter_screen_name @twitter_screen_name 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
.draftees(id, options = {}) ⇒ Object
Draftees
116 117 118 119 |
# File 'lib/dribble/player.rb', line 116 def draftees(id, ={}) results = Dribble::API::Player.draftees(id, ) Dribble::Draftees.new(format_players(results), results.merge(:player_name => id)) end |
.find_shots(id, options = {}) ⇒ Object
Find shots for a given player
76 77 78 79 |
# File 'lib/dribble/player.rb', line 76 def find_shots(id, ={}) results = Dribble::API::Player.find_shots(id, ) Dribble::Shots.new(format_shots(results), results.merge(:player_name => id)) end |
.followers(id, options = {}) ⇒ Object
Followers
102 103 104 105 106 |
# File 'lib/dribble/player.rb', line 102 def followers(id, ={}) puts "ID: #{id} OPTIONS: #{.inspect}" results = Dribble::API::Player.followers(id, ) Dribble::Followers.new(format_players(results), results.merge(:player_name => id)) end |
Instance Method Details
#draftees(options = {}) ⇒ Array
Player’s Shots
49 50 51 |
# File 'lib/dribble/player.rb', line 49 def draftees(={}) @draftees ||= Dribble::API::Player.draftees(self.id, ) end |