Class: Cricket::Request
- Inherits:
-
Object
- Object
- Cricket::Request
- Includes:
- HTTParty
- Defined in:
- lib/CricApi/helper/request.rb
Instance Method Summary collapse
- #ballByball(id) ⇒ Object
- #commentry(id) ⇒ Object
- #cricket ⇒ Object
- #cricketScore(id) ⇒ Object
- #getNews ⇒ Object
-
#initialize(service, page) ⇒ Request
constructor
A new instance of Request.
- #matchCalendar ⇒ Object
- #matches ⇒ Object
- #news(id) ⇒ Object
- #playerStats(id) ⇒ Object
- #score(id) ⇒ Object
Constructor Details
#initialize(service, page) ⇒ Request
Returns a new instance of Request.
9 10 11 |
# File 'lib/CricApi/helper/request.rb', line 9 def initialize(service, page) @options = { query: {site: service, page: page} } end |
Instance Method Details
#ballByball(id) ⇒ Object
45 46 47 48 49 50 51 |
# File 'lib/CricApi/helper/request.rb', line 45 def ballByball(id) self.class.post("/api/ballByBall", :body => { :unique_id => id } ) end |
#commentry(id) ⇒ Object
53 54 55 56 57 58 59 |
# File 'lib/CricApi/helper/request.rb', line 53 def commentry(id) self.class.post("/api/commentry", :body => { :unique_id => id } ) end |
#cricket ⇒ Object
13 14 15 |
# File 'lib/CricApi/helper/request.rb', line 13 def cricket self.class.get("/api/cricket", @options) end |
#cricketScore(id) ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/CricApi/helper/request.rb', line 29 def cricketScore(id) self.class.post("/api/cricketScore", :body => { :unique_id => id } ) end |
#getNews ⇒ Object
25 26 27 |
# File 'lib/CricApi/helper/request.rb', line 25 def getNews self.class.get("/api/news", @options) end |
#matchCalendar ⇒ Object
21 22 23 |
# File 'lib/CricApi/helper/request.rb', line 21 def matchCalendar self.class.get("/api/matchCalendar", @options) end |
#matches ⇒ Object
17 18 19 |
# File 'lib/CricApi/helper/request.rb', line 17 def matches self.class.get("/api/matches", @options) end |
#news(id) ⇒ Object
61 62 63 64 65 66 67 |
# File 'lib/CricApi/helper/request.rb', line 61 def news(id) self.class.post("/api/news", :body => { :unique_id => id } ) end |
#playerStats(id) ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/CricApi/helper/request.rb', line 37 def playerStats(id) self.class.post("/api/playerStats", :body => { :pid => id } ) end |
#score(id) ⇒ Object
69 70 71 72 73 74 75 |
# File 'lib/CricApi/helper/request.rb', line 69 def score(id) self.class.post("/api/score", :body => { :unique_id => id } ) end |