Class: Dribble::Shot

Inherits:
Object show all
Defined in:
lib/dribble/shot.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Shot

Returns a new instance of Shot.



7
8
9
10
11
12
# File 'lib/dribble/shot.rb', line 7

def initialize(attributes={})
  attributes.each do |key, value|
    instance_variable_set("@#{key}", value)
  end
  @player = Dribble::Player.new(attributes[:player]) if attributes[:player]
end

Instance Attribute Details

#comments_countObject (readonly)

Returns the value of attribute comments_count.



3
4
5
# File 'lib/dribble/shot.rb', line 3

def comments_count
  @comments_count
end

#created_atObject (readonly)

Returns the value of attribute created_at.



3
4
5
# File 'lib/dribble/shot.rb', line 3

def created_at
  @created_at
end

#heightObject (readonly)

Returns the value of attribute height.



3
4
5
# File 'lib/dribble/shot.rb', line 3

def height
  @height
end

#idObject (readonly)

Returns the value of attribute id.



3
4
5
# File 'lib/dribble/shot.rb', line 3

def id
  @id
end

#image_teaser_urlObject (readonly)

Returns the value of attribute image_teaser_url.



3
4
5
# File 'lib/dribble/shot.rb', line 3

def image_teaser_url
  @image_teaser_url
end

#image_urlObject (readonly)

Returns the value of attribute image_url.



3
4
5
# File 'lib/dribble/shot.rb', line 3

def image_url
  @image_url
end

#likes_countObject (readonly)

Returns the value of attribute likes_count.



3
4
5
# File 'lib/dribble/shot.rb', line 3

def likes_count
  @likes_count
end

#playerObject (readonly)

Returns the value of attribute player.



3
4
5
# File 'lib/dribble/shot.rb', line 3

def player
  @player
end

#rebounds_countObject (readonly)

Returns the value of attribute rebounds_count.



3
4
5
# File 'lib/dribble/shot.rb', line 3

def rebounds_count
  @rebounds_count
end

#titleObject (readonly)

Returns the value of attribute title.



3
4
5
# File 'lib/dribble/shot.rb', line 3

def title
  @title
end

#urlObject (readonly)

Returns the value of attribute url.



3
4
5
# File 'lib/dribble/shot.rb', line 3

def url
  @url
end

#views_countObject (readonly)

Returns the value of attribute views_count.



3
4
5
# File 'lib/dribble/shot.rb', line 3

def views_count
  @views_count
end

#widthObject (readonly)

Returns the value of attribute width.



3
4
5
# File 'lib/dribble/shot.rb', line 3

def width
  @width
end

Class Method Details

.debuts(options = {}) ⇒ Object

Debuts

Parameters:

  • e.g. (Hash)

    => 30, :page => 1

Returns:



64
65
66
67
# File 'lib/dribble/shot.rb', line 64

def self.debuts(options={})
  results = Dribble::API::Shot.debuts(options)
  Dribble::Debuts.new(format_shots(results), results)
end

.everyones(options = {}) ⇒ Object

Everyones

Parameters:

  • e.g. (Hash)

    => 30, :page => 1

Returns:



49
50
51
52
# File 'lib/dribble/shot.rb', line 49

def self.everyones(options={})
  results = Dribble::API::Shot.everyones(options)
  Dribble::Everyones.new(format_shots(results), results)
end

.following(id, options = {}) ⇒ Object

Following

Parameters:

  • (String/Integer)

Returns:



34
35
36
37
# File 'lib/dribble/shot.rb', line 34

def self.following(id, options={})
  results = Dribble::API::Shot.following(id, options)
  Dribble::Following.new(format_shots(results), results)
end

.for(id) ⇒ Object

By ID

Parameters:

  • (Integer)

Returns:



22
23
24
# File 'lib/dribble/shot.rb', line 22

def self.for(id)
  new(Dribble::API::Shot.for(id))
end

Popular

Parameters:

  • e.g. (Hash)

    => 30, :page => 1

Returns:



79
80
81
82
# File 'lib/dribble/shot.rb', line 79

def self.popular(options={})
  results = Dribble::API::Shot.popular(options)
  Dribble::Popular.new(format_shots(results), results)
end