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.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/lib/betfair_api_ng_rails/api/base_parser.rb +6 -2
  3. data/lib/betfair_api_ng_rails/api/base_provider.rb +2 -2
  4. data/lib/betfair_api_ng_rails/api/bf/parsers/soccer/cleared_order_parser.rb +13 -0
  5. data/lib/betfair_api_ng_rails/api/bf/parsers/soccer/competition_parser.rb +1 -5
  6. data/lib/betfair_api_ng_rails/api/bf/parsers/soccer/country_parser.rb +13 -0
  7. data/lib/betfair_api_ng_rails/api/bf/parsers/soccer/current_order_parser.rb +13 -0
  8. data/lib/betfair_api_ng_rails/api/bf/parsers/soccer/event_parser.rb +13 -0
  9. data/lib/betfair_api_ng_rails/api/bf/parsers/soccer/event_type_parser.rb +13 -0
  10. data/lib/betfair_api_ng_rails/api/bf/parsers/soccer/market_book_parser.rb +13 -0
  11. data/lib/betfair_api_ng_rails/api/bf/parsers/soccer/market_catalogue_parser.rb +13 -0
  12. data/lib/betfair_api_ng_rails/api/bf/parsers/soccer/market_profit_and_loss_parser.rb +13 -0
  13. data/lib/betfair_api_ng_rails/api/bf/parsers/soccer/market_type_parser.rb +13 -0
  14. data/lib/betfair_api_ng_rails/api/bf/parsers/soccer/time_range_parser.rb +13 -0
  15. data/lib/betfair_api_ng_rails/api/bf/parsers/soccer/venue_parser.rb +13 -0
  16. data/lib/betfair_api_ng_rails/api/soccer/cleared_order_requester.rb +10 -0
  17. data/lib/betfair_api_ng_rails/api/soccer/competition_requester.rb +1 -5
  18. data/lib/betfair_api_ng_rails/api/soccer/country_requester.rb +10 -0
  19. data/lib/betfair_api_ng_rails/api/soccer/current_order_requester.rb +10 -0
  20. data/lib/betfair_api_ng_rails/api/soccer/event_requester.rb +10 -0
  21. data/lib/betfair_api_ng_rails/api/soccer/event_type_requester.rb +10 -0
  22. data/lib/betfair_api_ng_rails/api/soccer/market_book_requester.rb +10 -0
  23. data/lib/betfair_api_ng_rails/api/soccer/market_catalogue_requester.rb +10 -0
  24. data/lib/betfair_api_ng_rails/api/soccer/market_profit_and_loss_requester.rb +10 -0
  25. data/lib/betfair_api_ng_rails/api/soccer/market_type_requester.rb +10 -0
  26. data/lib/betfair_api_ng_rails/api/soccer/requester.rb +4 -0
  27. data/lib/betfair_api_ng_rails/api/soccer/time_range_requester.rb +10 -0
  28. data/lib/betfair_api_ng_rails/api/soccer/venue_requester.rb +10 -0
  29. data/lib/betfair_api_ng_rails/version.rb +1 -1
  30. data/lib/betfair_api_ng_rails.rb +25 -3
  31. metadata +24 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 175bc8d3f3f69e5a9e78d95ba91e207fb951c05f
4
- data.tar.gz: e335dc1146bf08103dbf65e5e414c166ac4cec84
3
+ metadata.gz: a8ca4036f894f99635b1af2b2341de424a4412f8
4
+ data.tar.gz: c4a8389caa862033ba128c2367f9f0a204c5ac51
5
5
  SHA512:
6
- metadata.gz: 00506ec9d758ce164597a969ba211efb8418f1782edd8811adbd1aa09c84a3031c568c38e5065bd778cdd68708f7e978c25fed2644f412a814185b5c06ebf459
7
- data.tar.gz: 8d2d2c44f10b3e010b1442441fe16f311cb6f7fde47c6c8723f171218c373b2861dc3e96d092ececcd5e29763c58a03c2735fd181500c63e7918dfadf11dd99c
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
- raise "Must be reimplemented!"
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.pluralize.camelize}"
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
@@ -0,0 +1,13 @@
1
+ module BetfairApiNgRails
2
+ module Api
3
+ module BF
4
+ module Parsers
5
+ module Soccer
6
+ class ClearedOrderParser < Api::BaseParser
7
+
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
13
+ 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 process_competition(h)
10
+ def process_record(h)
15
11
  h.merge! h['competition']
16
12
  h.except! 'competition'
17
13
  h
@@ -0,0 +1,13 @@
1
+ module BetfairApiNgRails
2
+ module Api
3
+ module BF
4
+ module Parsers
5
+ module Soccer
6
+ class CountryParser < Api::BaseParser
7
+
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ module BetfairApiNgRails
2
+ module Api
3
+ module BF
4
+ module Parsers
5
+ module Soccer
6
+ class CurrentOrderParser < Api::BaseParser
7
+
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ module BetfairApiNgRails
2
+ module Api
3
+ module BF
4
+ module Parsers
5
+ module Soccer
6
+ class EventParser < Api::BaseParser
7
+
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ module BetfairApiNgRails
2
+ module Api
3
+ module BF
4
+ module Parsers
5
+ module Soccer
6
+ class EventTypeParser < Api::BaseParser
7
+
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ module BetfairApiNgRails
2
+ module Api
3
+ module BF
4
+ module Parsers
5
+ module Soccer
6
+ class MarketBookParser < Api::BaseParser
7
+
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ module BetfairApiNgRails
2
+ module Api
3
+ module BF
4
+ module Parsers
5
+ module Soccer
6
+ class MarketCatalogueParser < Api::BaseParser
7
+
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ module BetfairApiNgRails
2
+ module Api
3
+ module BF
4
+ module Parsers
5
+ module Soccer
6
+ class MarketProfitAndLossParser < Api::BaseParser
7
+
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ module BetfairApiNgRails
2
+ module Api
3
+ module BF
4
+ module Parsers
5
+ module Soccer
6
+ class MarketTypeParser < Api::BaseParser
7
+
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ module BetfairApiNgRails
2
+ module Api
3
+ module BF
4
+ module Parsers
5
+ module Soccer
6
+ class TimeRangeParser < Api::BaseParser
7
+
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ module BetfairApiNgRails
2
+ module Api
3
+ module BF
4
+ module Parsers
5
+ module Soccer
6
+ class VenueParser < Api::BaseParser
7
+
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,10 @@
1
+ module BetfairApiNgRails
2
+ class Api::Soccer::ClearedOrderRequester < BetfairApiNgRails::Api::Soccer::Requester
3
+
4
+ def initialize(provider: '')
5
+ @data = :cleared_orders
6
+ super provider
7
+ end
8
+
9
+ end
10
+ end
@@ -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 = :competition
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
@@ -0,0 +1,10 @@
1
+ module BetfairApiNgRails
2
+ class Api::Soccer::CountryRequester < BetfairApiNgRails::Api::Soccer::Requester
3
+
4
+ def initialize(provider: '')
5
+ @data = :countries
6
+ super provider
7
+ end
8
+
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ module BetfairApiNgRails
2
+ class Api::Soccer::CurrentOrderRequester < BetfairApiNgRails::Api::Soccer::Requester
3
+
4
+ def initialize(provider: '')
5
+ @data = :current_orders
6
+ super provider
7
+ end
8
+
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ module BetfairApiNgRails
2
+ class Api::Soccer::EventRequester < BetfairApiNgRails::Api::Soccer::Requester
3
+
4
+ def initialize(provider: '')
5
+ @data = :events
6
+ super provider
7
+ end
8
+
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ module BetfairApiNgRails
2
+ class Api::Soccer::EventTypeRequester < BetfairApiNgRails::Api::Soccer::Requester
3
+
4
+ def initialize(provider: '')
5
+ @data = :event_types
6
+ super provider
7
+ end
8
+
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ module BetfairApiNgRails
2
+ class Api::Soccer::MarketBookRequester < BetfairApiNgRails::Api::Soccer::Requester
3
+
4
+ def initialize(provider: '')
5
+ @data = :market_book
6
+ super provider
7
+ end
8
+
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ module BetfairApiNgRails
2
+ class Api::Soccer::MarketCatalogueRequester < BetfairApiNgRails::Api::Soccer::Requester
3
+
4
+ def initialize(provider: '')
5
+ @data = :market_catalogue
6
+ super provider
7
+ end
8
+
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ module BetfairApiNgRails
2
+ class Api::Soccer::MarketProfitAndLossRequester < BetfairApiNgRails::Api::Soccer::Requester
3
+
4
+ def initialize(provider: '')
5
+ @data = :market_profit_and_loss
6
+ super provider
7
+ end
8
+
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ module BetfairApiNgRails
2
+ class Api::Soccer::MarketTypeRequester < BetfairApiNgRails::Api::Soccer::Requester
3
+
4
+ def initialize(provider: '')
5
+ @data = :market_types
6
+ super provider
7
+ end
8
+
9
+ end
10
+ end
@@ -8,6 +8,10 @@ module BetfairApiNgRails
8
8
  super provider
9
9
  end
10
10
 
11
+ def load(parameters: {})
12
+ make_fetch parameters: parameters
13
+ end
14
+
11
15
  private
12
16
 
13
17
  def make_fetch(parameters: {})
@@ -0,0 +1,10 @@
1
+ module BetfairApiNgRails
2
+ class Api::Soccer::TimeRangeRequester < BetfairApiNgRails::Api::Soccer::Requester
3
+
4
+ def initialize(provider: '')
5
+ @data = :time_ranges
6
+ super provider
7
+ end
8
+
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ module BetfairApiNgRails
2
+ class Api::Soccer::VenueRequester < BetfairApiNgRails::Api::Soccer::Requester
3
+
4
+ def initialize(provider: '')
5
+ @data = :venues
6
+ super provider
7
+ end
8
+
9
+ end
10
+ end
@@ -1,3 +1,3 @@
1
1
  module BetfairApiNgRails
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -21,7 +21,18 @@ module BetfairApiNgRails
21
21
 
22
22
  module Soccer
23
23
 
24
- autoload :CompetitionParser, 'betfair_api_ng_rails/api/bf/parsers/soccer/competition_parser'
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, 'betfair_api_ng_rails/api/soccer/requester'
35
- autoload :CompetitionRequester, 'betfair_api_ng_rails/api/soccer/competition_requester'
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.2
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-14 00:00:00.000000000 Z
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