lib/dribble/api/shot.rb in dribble-0.1.2 vs lib/dribble/api/shot.rb in dribble-0.1.3
- old
+ new
@@ -1,84 +1,86 @@
module Dribble
module API
class Shot
-
- ##
- # By ID
- #
- # @param [Integer]
- # @return [Hash]
- # @api public
- #
- def self.for(id)
- Dribble::Request.get("/shots/#{id.to_i}")
- end
+ class << self
+
+ ##
+ # By ID
+ #
+ # @param [Integer]
+ # @return [Hash]
+ # @api public
+ #
+ def for(id)
+ Dribble::Request.get("/shots/#{id.to_i}")
+ end
- ##
- # Following
- #
- # @param [String/Integer, Hash]
- # e.g. {:per_page => 30, :page => 1}
- #
- # @return [Hash]
- # @api public
- #
- def self.following(id, options={})
- Dribble::Request.get("/players/#{id}/shots/following", setup_options(options))
- end
+ ##
+ # Following
+ #
+ # @param [String/Integer, Hash]
+ # e.g. {:per_page => 30, :page => 1}
+ #
+ # @return [Hash]
+ # @api public
+ #
+ def following(id, options={})
+ Dribble::Request.get("/players/#{id}/shots/following", setup_options(options))
+ end
- ##
- # Everyones
- #
- # @param [Hash]
- # e.g. {:per_page => 30, :page => 1}
- #
- # @return [Array]
- # @api public
- #
- def self.everyones(options={})
- Dribble::Request.get("/shots/everyone", setup_options(options))
- end
+ ##
+ # Everyones
+ #
+ # @param [Hash]
+ # e.g. {:per_page => 30, :page => 1}
+ #
+ # @return [Array]
+ # @api public
+ #
+ def everyones(options={})
+ Dribble::Request.get("/shots/everyone", setup_options(options))
+ end
+ alias_method :everyone, :everyones
+
+ ##
+ # Debuts
+ #
+ # @param [Hash]
+ # e.g. {:per_page => 30, :page => 1}
+ #
+ # @return [Array]
+ # @api public
+ #
+ def debuts(options={})
+ Dribble::Request.get("/shots/debuts", setup_options(options))
+ end
- ##
- # Debuts
- #
- # @param [Hash]
- # e.g. {:per_page => 30, :page => 1}
- #
- # @return [Array]
- # @api public
- #
- def self.debuts(options={})
- Dribble::Request.get("/shots/debuts", setup_options(options))
- end
-
- ##
- # Popular
- #
- # @param [Hash]
- # e.g. {:per_page => 30, :page => 1}
- #
- # @return [Array]
- # @api public
- #
- def self.popular(options={})
- Dribble::Request.get("/shots/popular", setup_options(options))
- end
+ ##
+ # Popular
+ #
+ # @param [Hash]
+ # e.g. {:per_page => 30, :page => 1}
+ #
+ # @return [Array]
+ # @api public
+ #
+ def popular(options={})
+ Dribble::Request.get("/shots/popular", setup_options(options))
+ end
- private
+ private
- def self.setup_options(options)
- {:per_page => 30, :page => 1}.merge(options)
- end
-
-
+ def setup_options(options)
+ {:per_page => 30, :page => 1}.merge(options)
+ end
+
+ end
end
end
end
\ No newline at end of file