betfair_api_ng_rails 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/betfair_api_ng_rails/api/base_parser.rb +6 -2
- data/lib/betfair_api_ng_rails/api/base_provider.rb +2 -2
- data/lib/betfair_api_ng_rails/api/bf/parsers/soccer/cleared_order_parser.rb +13 -0
- data/lib/betfair_api_ng_rails/api/bf/parsers/soccer/competition_parser.rb +1 -5
- data/lib/betfair_api_ng_rails/api/bf/parsers/soccer/country_parser.rb +13 -0
- data/lib/betfair_api_ng_rails/api/bf/parsers/soccer/current_order_parser.rb +13 -0
- data/lib/betfair_api_ng_rails/api/bf/parsers/soccer/event_parser.rb +13 -0
- data/lib/betfair_api_ng_rails/api/bf/parsers/soccer/event_type_parser.rb +13 -0
- data/lib/betfair_api_ng_rails/api/bf/parsers/soccer/market_book_parser.rb +13 -0
- data/lib/betfair_api_ng_rails/api/bf/parsers/soccer/market_catalogue_parser.rb +13 -0
- data/lib/betfair_api_ng_rails/api/bf/parsers/soccer/market_profit_and_loss_parser.rb +13 -0
- data/lib/betfair_api_ng_rails/api/bf/parsers/soccer/market_type_parser.rb +13 -0
- data/lib/betfair_api_ng_rails/api/bf/parsers/soccer/time_range_parser.rb +13 -0
- data/lib/betfair_api_ng_rails/api/bf/parsers/soccer/venue_parser.rb +13 -0
- data/lib/betfair_api_ng_rails/api/soccer/cleared_order_requester.rb +10 -0
- data/lib/betfair_api_ng_rails/api/soccer/competition_requester.rb +1 -5
- data/lib/betfair_api_ng_rails/api/soccer/country_requester.rb +10 -0
- data/lib/betfair_api_ng_rails/api/soccer/current_order_requester.rb +10 -0
- data/lib/betfair_api_ng_rails/api/soccer/event_requester.rb +10 -0
- data/lib/betfair_api_ng_rails/api/soccer/event_type_requester.rb +10 -0
- data/lib/betfair_api_ng_rails/api/soccer/market_book_requester.rb +10 -0
- data/lib/betfair_api_ng_rails/api/soccer/market_catalogue_requester.rb +10 -0
- data/lib/betfair_api_ng_rails/api/soccer/market_profit_and_loss_requester.rb +10 -0
- data/lib/betfair_api_ng_rails/api/soccer/market_type_requester.rb +10 -0
- data/lib/betfair_api_ng_rails/api/soccer/requester.rb +4 -0
- data/lib/betfair_api_ng_rails/api/soccer/time_range_requester.rb +10 -0
- data/lib/betfair_api_ng_rails/api/soccer/venue_requester.rb +10 -0
- data/lib/betfair_api_ng_rails/version.rb +1 -1
- data/lib/betfair_api_ng_rails.rb +25 -3
- metadata +24 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8ca4036f894f99635b1af2b2341de424a4412f8
|
4
|
+
data.tar.gz: c4a8389caa862033ba128c2367f9f0a204c5ac51
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a5cf2adf3d26028237f488e2a2fbbbcb6b4601bca0270ed68c8d5905c31a3e99c0e4f89d7409b77980ab09e2c20522f759434f76e8cbb4413dad39444eec9af
|
7
|
+
data.tar.gz: 8e0ddec22f0bd8a391d96d337d11ab63ebe65271f9841e0a3c40d305161116bd5e302597f3b8acfe49ea5fc156e5237d6ea21e648b7326e6ec9061f14d420dba
|
@@ -4,8 +4,8 @@ module BetfairApiNgRails
|
|
4
4
|
module Api
|
5
5
|
class BaseParser
|
6
6
|
|
7
|
-
def parse(response:
|
8
|
-
|
7
|
+
def parse(response: {})
|
8
|
+
response.fetch('result', []).map { |r| process_record(r) }
|
9
9
|
end
|
10
10
|
|
11
11
|
private
|
@@ -16,6 +16,10 @@ module BetfairApiNgRails
|
|
16
16
|
{}
|
17
17
|
end
|
18
18
|
|
19
|
+
def process_record(h)
|
20
|
+
h
|
21
|
+
end
|
22
|
+
|
19
23
|
end
|
20
24
|
end
|
21
25
|
end
|
@@ -11,11 +11,11 @@ module BetfairApiNgRails
|
|
11
11
|
private
|
12
12
|
|
13
13
|
def build_function(method)
|
14
|
-
"list#{method.to_s.
|
14
|
+
"list#{method.to_s.camelize}"
|
15
15
|
end
|
16
16
|
|
17
17
|
def build_parser(data, sport)
|
18
|
-
"BetfairApiNgRails::Api::BF::Parsers::#{sport.to_s.camelize}::#{data.to_s.camelize}Parser".constantize.new
|
18
|
+
"BetfairApiNgRails::Api::BF::Parsers::#{sport.to_s.camelize}::#{data.to_s.singularize.camelize}Parser".constantize.new
|
19
19
|
end
|
20
20
|
|
21
21
|
end
|
@@ -5,13 +5,9 @@ module BetfairApiNgRails
|
|
5
5
|
module Soccer
|
6
6
|
class CompetitionParser < Api::BaseParser
|
7
7
|
|
8
|
-
def parse(response: {})
|
9
|
-
response['result'].map { |r| process_competition(r) }
|
10
|
-
end
|
11
|
-
|
12
8
|
private
|
13
9
|
|
14
|
-
def
|
10
|
+
def process_record(h)
|
15
11
|
h.merge! h['competition']
|
16
12
|
h.except! 'competition'
|
17
13
|
h
|
@@ -2,13 +2,9 @@ module BetfairApiNgRails
|
|
2
2
|
class Api::Soccer::CompetitionRequester < BetfairApiNgRails::Api::Soccer::Requester
|
3
3
|
|
4
4
|
def initialize(provider: '')
|
5
|
-
@data = :
|
5
|
+
@data = :competitions
|
6
6
|
super provider
|
7
7
|
end
|
8
8
|
|
9
|
-
def load(parameters: {})
|
10
|
-
make_fetch parameters: parameters
|
11
|
-
end
|
12
|
-
|
13
9
|
end
|
14
10
|
end
|
data/lib/betfair_api_ng_rails.rb
CHANGED
@@ -21,7 +21,18 @@ module BetfairApiNgRails
|
|
21
21
|
|
22
22
|
module Soccer
|
23
23
|
|
24
|
-
autoload :CompetitionParser,
|
24
|
+
autoload :CompetitionParser, 'betfair_api_ng_rails/api/bf/parsers/soccer/competition_parser'
|
25
|
+
autoload :EventTypeParser, 'betfair_api_ng_rails/api/bf/parsers/soccer/event_type_parser'
|
26
|
+
autoload :TimeRangeParser, 'betfair_api_ng_rails/api/bf/parsers/soccer/time_range_parser'
|
27
|
+
autoload :EventParser, 'betfair_api_ng_rails/api/bf/parsers/soccer/event_parser'
|
28
|
+
autoload :MarketTypeParser, 'betfair_api_ng_rails/api/bf/parsers/soccer/market_type_parser'
|
29
|
+
autoload :CountryParser, 'betfair_api_ng_rails/api/bf/parsers/soccer/country_parser'
|
30
|
+
autoload :VenueParser, 'betfair_api_ng_rails/api/bf/parsers/soccer/venue_parser'
|
31
|
+
autoload :MarketCatalogueParser, 'betfair_api_ng_rails/api/bf/parsers/soccer/market_catalogue_parser'
|
32
|
+
autoload :MarketBookParser, 'betfair_api_ng_rails/api/bf/parsers/soccer/market_book_parser'
|
33
|
+
autoload :CurrentOrderParser, 'betfair_api_ng_rails/api/bf/parsers/soccer/current_order_parser'
|
34
|
+
autoload :ClearedOrderParser, 'betfair_api_ng_rails/api/bf/parsers/soccer/cleared_order_parser'
|
35
|
+
autoload :MarketProfitAndLossParser, 'betfair_api_ng_rails/api/bf/parsers/soccer/market_profit_and_loss_parser'
|
25
36
|
|
26
37
|
end
|
27
38
|
|
@@ -31,8 +42,19 @@ module BetfairApiNgRails
|
|
31
42
|
|
32
43
|
module Soccer
|
33
44
|
|
34
|
-
autoload :Requester,
|
35
|
-
autoload :CompetitionRequester,
|
45
|
+
autoload :Requester, 'betfair_api_ng_rails/api/soccer/requester'
|
46
|
+
autoload :CompetitionRequester, 'betfair_api_ng_rails/api/soccer/competition_requester'
|
47
|
+
autoload :EventTypeRequester, 'betfair_api_ng_rails/api/soccer/event_type_requester'
|
48
|
+
autoload :TimeRangeRequester, 'betfair_api_ng_rails/api/soccer/time_range_requester'
|
49
|
+
autoload :EventRequester, 'betfair_api_ng_rails/api/soccer/event_requester'
|
50
|
+
autoload :MarketTypeRequester, 'betfair_api_ng_rails/api/soccer/market_type_requester'
|
51
|
+
autoload :CountryRequester, 'betfair_api_ng_rails/api/soccer/country_requester'
|
52
|
+
autoload :VenueRequester, 'betfair_api_ng_rails/api/soccer/venue_requester'
|
53
|
+
autoload :MarketCatalogueRequester, 'betfair_api_ng_rails/api/soccer/market_catalogue_requester'
|
54
|
+
autoload :MarketBookRequester, 'betfair_api_ng_rails/api/soccer/market_book_requester'
|
55
|
+
autoload :CurrentOrderRequester, 'betfair_api_ng_rails/api/soccer/current_order_requester'
|
56
|
+
autoload :ClearedOrderRequester, 'betfair_api_ng_rails/api/soccer/cleared_order_requester'
|
57
|
+
autoload :MarketProfitAndLossRequester, 'betfair_api_ng_rails/api/soccer/market_profit_and_loss_requester'
|
36
58
|
|
37
59
|
end
|
38
60
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: betfair_api_ng_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sergio1990
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -74,11 +74,33 @@ files:
|
|
74
74
|
- lib/betfair_api_ng_rails/api/bf/constants.rb
|
75
75
|
- lib/betfair_api_ng_rails/api/bf/http_requester.rb
|
76
76
|
- lib/betfair_api_ng_rails/api/bf/http_responser.rb
|
77
|
+
- lib/betfair_api_ng_rails/api/bf/parsers/soccer/cleared_order_parser.rb
|
77
78
|
- lib/betfair_api_ng_rails/api/bf/parsers/soccer/competition_parser.rb
|
79
|
+
- lib/betfair_api_ng_rails/api/bf/parsers/soccer/country_parser.rb
|
80
|
+
- lib/betfair_api_ng_rails/api/bf/parsers/soccer/current_order_parser.rb
|
81
|
+
- lib/betfair_api_ng_rails/api/bf/parsers/soccer/event_parser.rb
|
82
|
+
- lib/betfair_api_ng_rails/api/bf/parsers/soccer/event_type_parser.rb
|
83
|
+
- lib/betfair_api_ng_rails/api/bf/parsers/soccer/market_book_parser.rb
|
84
|
+
- lib/betfair_api_ng_rails/api/bf/parsers/soccer/market_catalogue_parser.rb
|
85
|
+
- lib/betfair_api_ng_rails/api/bf/parsers/soccer/market_profit_and_loss_parser.rb
|
86
|
+
- lib/betfair_api_ng_rails/api/bf/parsers/soccer/market_type_parser.rb
|
87
|
+
- lib/betfair_api_ng_rails/api/bf/parsers/soccer/time_range_parser.rb
|
88
|
+
- lib/betfair_api_ng_rails/api/bf/parsers/soccer/venue_parser.rb
|
78
89
|
- lib/betfair_api_ng_rails/api/bf/provider.rb
|
79
90
|
- lib/betfair_api_ng_rails/api/bf/session_manager.rb
|
91
|
+
- lib/betfair_api_ng_rails/api/soccer/cleared_order_requester.rb
|
80
92
|
- lib/betfair_api_ng_rails/api/soccer/competition_requester.rb
|
93
|
+
- lib/betfair_api_ng_rails/api/soccer/country_requester.rb
|
94
|
+
- lib/betfair_api_ng_rails/api/soccer/current_order_requester.rb
|
95
|
+
- lib/betfair_api_ng_rails/api/soccer/event_requester.rb
|
96
|
+
- lib/betfair_api_ng_rails/api/soccer/event_type_requester.rb
|
97
|
+
- lib/betfair_api_ng_rails/api/soccer/market_book_requester.rb
|
98
|
+
- lib/betfair_api_ng_rails/api/soccer/market_catalogue_requester.rb
|
99
|
+
- lib/betfair_api_ng_rails/api/soccer/market_profit_and_loss_requester.rb
|
100
|
+
- lib/betfair_api_ng_rails/api/soccer/market_type_requester.rb
|
81
101
|
- lib/betfair_api_ng_rails/api/soccer/requester.rb
|
102
|
+
- lib/betfair_api_ng_rails/api/soccer/time_range_requester.rb
|
103
|
+
- lib/betfair_api_ng_rails/api/soccer/venue_requester.rb
|
82
104
|
- lib/betfair_api_ng_rails/version.rb
|
83
105
|
- lib/generators/betfair_api_ng_rails/install/install_generator.rb
|
84
106
|
- lib/generators/betfair_api_ng_rails/install/templates/betfair_api_ng_rails.rb
|