betfair_api_ng_rails 1.1.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (181) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +26 -1
  3. data/Rakefile +8 -8
  4. data/betfair_api_ng_rails.gemspec +12 -7
  5. data/lib/betfair_api_ng_rails.rb +162 -98
  6. data/lib/betfair_api_ng_rails/account.rb +4 -0
  7. data/lib/betfair_api_ng_rails/account_manager.rb +36 -0
  8. data/lib/betfair_api_ng_rails/account_session.rb +5 -0
  9. data/lib/betfair_api_ng_rails/account_session_manager.rb +29 -0
  10. data/lib/betfair_api_ng_rails/api/caching/helper.rb +34 -0
  11. data/lib/betfair_api_ng_rails/api/caching/response_cache.rb +57 -0
  12. data/lib/betfair_api_ng_rails/api/concerns/errorable.rb +1 -3
  13. data/lib/betfair_api_ng_rails/api/config.rb +20 -8
  14. data/lib/betfair_api_ng_rails/api/connection.rb +28 -10
  15. data/lib/betfair_api_ng_rails/api/connection_ext/caching.rb +60 -0
  16. data/lib/betfair_api_ng_rails/api/connection_ext/error_handling.rb +5 -1
  17. data/lib/betfair_api_ng_rails/api/connection_ext/logging.rb +34 -0
  18. data/lib/betfair_api_ng_rails/api/connection_ext/parsing.rb +2 -4
  19. data/lib/betfair_api_ng_rails/api/connection_ext/ssoid_refreshing.rb +40 -0
  20. data/lib/betfair_api_ng_rails/api/constants.rb +39 -18
  21. data/lib/betfair_api_ng_rails/api/data/account_details_response.rb +27 -0
  22. data/lib/betfair_api_ng_rails/api/data/account_funds_response.rb +26 -0
  23. data/lib/betfair_api_ng_rails/api/data/account_statement_report.rb +17 -0
  24. data/lib/betfair_api_ng_rails/api/data/competition.rb +3 -4
  25. data/lib/betfair_api_ng_rails/api/data/competition_result.rb +1 -3
  26. data/lib/betfair_api_ng_rails/api/data/concerns/attributable.rb +2 -6
  27. data/lib/betfair_api_ng_rails/api/data/concerns/hashable.rb +11 -4
  28. data/lib/betfair_api_ng_rails/api/data/constants.rb +2 -4
  29. data/lib/betfair_api_ng_rails/api/data/country_code_result.rb +1 -3
  30. data/lib/betfair_api_ng_rails/api/data/event.rb +1 -2
  31. data/lib/betfair_api_ng_rails/api/data/event_result.rb +1 -3
  32. data/lib/betfair_api_ng_rails/api/data/limit_on_close_order.rb +22 -0
  33. data/lib/betfair_api_ng_rails/api/data/limit_order.rb +23 -0
  34. data/lib/betfair_api_ng_rails/api/data/market_book.rb +2 -4
  35. data/lib/betfair_api_ng_rails/api/data/market_filter.rb +3 -2
  36. data/lib/betfair_api_ng_rails/api/data/market_on_close_order.rb +20 -0
  37. data/lib/betfair_api_ng_rails/api/data/order.rb +1 -3
  38. data/lib/betfair_api_ng_rails/api/data/place_execution_report.rb +24 -0
  39. data/lib/betfair_api_ng_rails/api/data/place_instruction.rb +25 -0
  40. data/lib/betfair_api_ng_rails/api/data/place_instruction_report.rb +27 -0
  41. data/lib/betfair_api_ng_rails/api/data/statement_item.rb +30 -0
  42. data/lib/betfair_api_ng_rails/api/data/statement_legacy_data.rb +40 -0
  43. data/lib/betfair_api_ng_rails/api/endpoint_factory.rb +21 -0
  44. data/lib/betfair_api_ng_rails/api/endpoints/australian.rb +17 -0
  45. data/lib/betfair_api_ng_rails/api/endpoints/base.rb +42 -0
  46. data/lib/betfair_api_ng_rails/api/endpoints/italian.rb +17 -0
  47. data/lib/betfair_api_ng_rails/api/endpoints/spanish.rb +17 -0
  48. data/lib/betfair_api_ng_rails/api/endpoints/uk.rb +17 -0
  49. data/lib/betfair_api_ng_rails/api/enums/execution_report_error_code.rb +22 -1
  50. data/lib/betfair_api_ng_rails/api/enums/execution_report_status.rb +12 -1
  51. data/lib/betfair_api_ng_rails/api/enums/include_item.rb +23 -0
  52. data/lib/betfair_api_ng_rails/api/enums/instruction_report_error_code.rb +25 -1
  53. data/lib/betfair_api_ng_rails/api/enums/instruction_report_status.rb +8 -1
  54. data/lib/betfair_api_ng_rails/api/enums/item_class.rb +19 -0
  55. data/lib/betfair_api_ng_rails/api/enums/order_status.rb +7 -1
  56. data/lib/betfair_api_ng_rails/api/enums/order_type.rb +11 -2
  57. data/lib/betfair_api_ng_rails/api/enums/persistence_type.rb +8 -1
  58. data/lib/betfair_api_ng_rails/api/enums/side.rb +7 -2
  59. data/lib/betfair_api_ng_rails/api/enums/wallet.rb +20 -0
  60. data/lib/betfair_api_ng_rails/api/formatter_factory.rb +2 -4
  61. data/lib/betfair_api_ng_rails/api/formatters/js_tree_formatter.rb +2 -4
  62. data/lib/betfair_api_ng_rails/api/hashalator.rb +6 -6
  63. data/lib/betfair_api_ng_rails/api/helper.rb +2 -4
  64. data/lib/betfair_api_ng_rails/api/http/factory.rb +19 -14
  65. data/lib/betfair_api_ng_rails/api/http/helpers/information_response.rb +2 -4
  66. data/lib/betfair_api_ng_rails/api/http/helpers/keep_alive_response.rb +3 -4
  67. data/lib/betfair_api_ng_rails/api/http/helpers/session_response.rb +3 -4
  68. data/lib/betfair_api_ng_rails/api/http/proxy_requester.rb +87 -0
  69. data/lib/betfair_api_ng_rails/api/http/requester.rb +3 -3
  70. data/lib/betfair_api_ng_rails/api/http/responser.rb +4 -3
  71. data/lib/betfair_api_ng_rails/api/invalid_endpoint_error.rb +6 -0
  72. data/lib/betfair_api_ng_rails/api/logs/console_logger.rb +13 -0
  73. data/lib/betfair_api_ng_rails/api/logs/file_logger.rb +23 -0
  74. data/lib/betfair_api_ng_rails/api/parsers/base.rb +14 -6
  75. data/lib/betfair_api_ng_rails/api/parsers/get_account_details.rb +13 -0
  76. data/lib/betfair_api_ng_rails/api/parsers/get_account_funds.rb +14 -0
  77. data/lib/betfair_api_ng_rails/api/parsers/get_account_statement.rb +15 -0
  78. data/lib/betfair_api_ng_rails/api/parsers/list_base.rb +18 -0
  79. data/lib/betfair_api_ng_rails/api/parsers/list_competitions.rb +5 -7
  80. data/lib/betfair_api_ng_rails/api/parsers/list_countries.rb +5 -7
  81. data/lib/betfair_api_ng_rails/api/parsers/list_event_types.rb +5 -7
  82. data/lib/betfair_api_ng_rails/api/parsers/list_events.rb +5 -7
  83. data/lib/betfair_api_ng_rails/api/parsers/list_market_book.rb +5 -7
  84. data/lib/betfair_api_ng_rails/api/parsers/list_market_catalogue.rb +5 -7
  85. data/lib/betfair_api_ng_rails/api/parsers/list_market_types.rb +5 -7
  86. data/lib/betfair_api_ng_rails/api/parsers/list_time_ranges.rb +5 -7
  87. data/lib/betfair_api_ng_rails/api/parsers/list_venues.rb +5 -7
  88. data/lib/betfair_api_ng_rails/api/parsers/place_orders.rb +14 -0
  89. data/lib/betfair_api_ng_rails/api/parsers/single_base.rb +19 -0
  90. data/lib/betfair_api_ng_rails/api/provider.rb +11 -14
  91. data/lib/betfair_api_ng_rails/api/request_method.rb +43 -0
  92. data/lib/betfair_api_ng_rails/api/request_methods/account.rb +51 -0
  93. data/lib/betfair_api_ng_rails/api/request_methods/all.rb +26 -0
  94. data/lib/betfair_api_ng_rails/api/request_methods/betting.rb +30 -0
  95. data/lib/betfair_api_ng_rails/api/session_manager.rb +34 -31
  96. data/lib/betfair_api_ng_rails/bad_response_error.rb +4 -0
  97. data/lib/betfair_api_ng_rails/errors.rb +3 -2
  98. data/lib/betfair_api_ng_rails/railtie.rb +7 -2
  99. data/lib/betfair_api_ng_rails/version.rb +1 -1
  100. data/lib/generators/betfair_api_ng_rails/install/templates/betfair_api_ng_rails.rb +20 -11
  101. data/lib/generators/betfair_api_ng_rails/install/templates/betfair_api_ng_rails.yml +5 -7
  102. data/spec/lib/betfair_api_ng_rails/account_manager_spec.rb +76 -0
  103. data/spec/lib/betfair_api_ng_rails/account_session_manager_spec.rb +59 -0
  104. data/spec/lib/betfair_api_ng_rails/account_session_spec.rb +13 -0
  105. data/spec/lib/betfair_api_ng_rails/account_spec.rb +18 -0
  106. data/spec/lib/betfair_api_ng_rails/api/caching/helper_spec.rb +89 -0
  107. data/spec/lib/betfair_api_ng_rails/api/caching/response_cache_spec.rb +131 -0
  108. data/spec/lib/betfair_api_ng_rails/api/config_spec.rb +37 -0
  109. data/spec/lib/betfair_api_ng_rails/api/connection_spec.rb +99 -0
  110. data/spec/lib/betfair_api_ng_rails/api/data/account_statement_report_spec.rb +11 -0
  111. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/competition_result_spec.rb +0 -0
  112. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/competition_spec.rb +0 -0
  113. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/concerns/attributable_spec.rb +0 -0
  114. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/concerns/hashable_spec.rb +16 -32
  115. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/concerns/jsonable_spec.rb +0 -0
  116. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/country_code_result_spec.rb +0 -0
  117. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/event_result_spec.rb +0 -0
  118. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/event_spec.rb +0 -0
  119. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/event_type_result_spec.rb +0 -0
  120. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/event_type_spec.rb +0 -0
  121. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/ex_best_offers_overrides_spec.rb +0 -0
  122. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/exchange_prices_spec.rb +0 -0
  123. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/market_book_spec.rb +1 -6
  124. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/market_catalogue_spec.rb +0 -0
  125. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/market_description_spec.rb +0 -0
  126. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/market_filter_spec.rb +0 -0
  127. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/market_type_result_spec.rb +0 -0
  128. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/match_spec.rb +0 -0
  129. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/order_spec.rb +0 -0
  130. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/price_projection_spec.rb +0 -0
  131. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/price_size_spec.rb +0 -0
  132. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/runner_catalog_spec.rb +0 -0
  133. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/runner_spec.rb +0 -0
  134. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/starting_prices_spec.rb +0 -0
  135. data/spec/lib/betfair_api_ng_rails/api/data/statement_item_spec.rb +9 -0
  136. data/spec/lib/betfair_api_ng_rails/api/data/statement_legacy_data_spec.rb +6 -0
  137. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/time_range_result_spec.rb +0 -0
  138. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/time_range_spec.rb +1 -3
  139. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/venue_result_spec.rb +0 -0
  140. data/spec/lib/betfair_api_ng_rails/api/endpoint_factory_spec.rb +27 -0
  141. data/spec/lib/betfair_api_ng_rails/api/endpoints/australian_spec.rb +6 -0
  142. data/spec/lib/betfair_api_ng_rails/api/endpoints/base_spec.rb +5 -0
  143. data/spec/lib/betfair_api_ng_rails/api/endpoints/italian_spec.rb +6 -0
  144. data/spec/lib/betfair_api_ng_rails/api/endpoints/spanish_spec.rb +7 -0
  145. data/spec/lib/betfair_api_ng_rails/api/endpoints/uk_spec.rb +6 -0
  146. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/formatters/js_tree_formatter_spec.rb +0 -0
  147. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/hashalator_spec.rb +27 -46
  148. data/spec/lib/betfair_api_ng_rails/api/http/factory_spec.rb +40 -0
  149. data/spec/lib/betfair_api_ng_rails/api/logs/console_logger_spec.rb +18 -0
  150. data/spec/lib/betfair_api_ng_rails/api/logs/file_logger_spec.rb +33 -0
  151. data/spec/lib/betfair_api_ng_rails/api/provider_spec.rb +53 -0
  152. data/spec/lib/betfair_api_ng_rails/api/request_method_spec.rb +38 -0
  153. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/request_methods_spec.rb +47 -32
  154. data/spec/lib/betfair_api_ng_rails/api/session_manager_spec.rb +77 -0
  155. data/spec/lib/betfair_api_ng_rails/integration/get_account_statement_spec.rb +57 -0
  156. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/integration/list_competitions_spec.rb +7 -9
  157. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/integration/list_countries_spec.rb +7 -9
  158. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/integration/list_event_types_spec.rb +7 -9
  159. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/integration/list_events_spec.rb +7 -9
  160. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/integration/list_market_book_spec.rb +7 -9
  161. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/integration/list_market_catalogue_spec.rb +7 -16
  162. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/integration/list_market_types_spec.rb +7 -9
  163. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/integration/list_time_ranges_spec.rb +7 -9
  164. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/integration/list_venues_spec.rb +7 -9
  165. data/spec/lib/betfair_api_ng_rails/integration/place_orders_spec.rb +55 -0
  166. data/spec/spec_helper.rb +9 -1
  167. data/spec/support/base_yaml_loader.rb +2 -4
  168. data/spec/support/data/models.yml +37 -1
  169. data/spec/support/data_models_yaml_loader.rb +1 -3
  170. data/spec/support/have_attr_accessor.rb +18 -0
  171. data/spec/support/helper.rb +1 -3
  172. data/spec/support/shared_examples/base_endpoint.rb +5 -0
  173. data/spec/support/shared_examples/concrete_endpoint.rb +28 -0
  174. data/spec/support/shared_examples/data_model.rb +2 -11
  175. data/spec/support/shared_examples/request_method.rb +5 -8
  176. data/spec/support/shared_examples/simple_list_filtering_request.rb +10 -19
  177. metadata +252 -117
  178. data/lib/betfair_api_ng_rails/api/request_methods.rb +0 -41
  179. data/spec/betfair_api_ng_rails/api/connection_spec.rb +0 -76
  180. data/spec/betfair_api_ng_rails/api/provider_spec.rb +0 -91
  181. data/spec/betfair_api_ng_rails/api/session_manager_spec.rb +0 -59
@@ -0,0 +1,27 @@
1
+ module BetfairApiNgRails
2
+ module Api
3
+ module Data
4
+ class AccountDetailsResponse < Api::Data::Base
5
+ include Api::Data::Concerns::Hashable
6
+
7
+ ACCOUNT_DETAILS_RESPONSE_ATTRS = [
8
+ :currency_code,
9
+ :first_name,
10
+ :last_name,
11
+ :locale_code,
12
+ :region,
13
+ :timezone,
14
+ :discount_rate,
15
+ :points_balance
16
+ ]
17
+
18
+ attributes ACCOUNT_DETAILS_RESPONSE_ATTRS
19
+
20
+ def self.to_hash_attrs
21
+ ACCOUNT_DETAILS_RESPONSE_ATTRS
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+
@@ -0,0 +1,26 @@
1
+ module BetfairApiNgRails
2
+ module Api
3
+ module Data
4
+ class AccountFundsResponse < Api::Data::Base
5
+ include Api::Data::Concerns::Hashable
6
+
7
+ ACCOUNT_FUNDS_RESPONSE_ATTRS = [
8
+ :available_to_bet_balance,
9
+ :exposure,
10
+ :retained_comission,
11
+ :exposure_limit,
12
+ :discount_rate,
13
+ :points_balance
14
+ ]
15
+
16
+ attributes ACCOUNT_FUNDS_RESPONSE_ATTRS
17
+
18
+ def self.to_hash_attrs
19
+ ACCOUNT_FUNDS_RESPONSE_ATTRS
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+
26
+
@@ -0,0 +1,17 @@
1
+ module BetfairApiNgRails
2
+ module Api
3
+ module Data
4
+ #
5
+ # A container representing search results.
6
+ #
7
+ class AccountStatementReport < Api::Data::Base
8
+ ACCOUNT_STATEMENT_REPORT_ATTRS = [
9
+ :more_available,
10
+ { account_statement: { type: BetfairApiNgRails::StatementItem, array: true } }
11
+ ]
12
+
13
+ attributes ACCOUNT_STATEMENT_REPORT_ATTRS
14
+ end
15
+ end
16
+ end
17
+ end
@@ -8,14 +8,13 @@ module BetfairApiNgRails
8
8
  :id,
9
9
  :name
10
10
  ]
11
-
11
+
12
12
  attributes COMPETITION_ATTRS
13
-
13
+
14
14
  def self.to_hash_attrs
15
15
  COMPETITION_ATTRS
16
16
  end
17
-
18
17
  end
19
18
  end
20
19
  end
21
- end
20
+ end
@@ -2,7 +2,6 @@ module BetfairApiNgRails
2
2
  module Api
3
3
  module Data
4
4
  class CompetitionResult < Api::Data::Base
5
-
6
5
  COMPETITION_RESULT_ATTRS = [
7
6
  :market_count,
8
7
  :competition_region,
@@ -10,8 +9,7 @@ module BetfairApiNgRails
10
9
  ]
11
10
 
12
11
  attributes COMPETITION_RESULT_ATTRS
13
-
14
12
  end
15
13
  end
16
14
  end
17
- end
15
+ end
@@ -3,7 +3,6 @@ module BetfairApiNgRails
3
3
  module Data
4
4
  module Concerns
5
5
  module Attributable
6
-
7
6
  DEFAULT_OPTIONS = { type: String, array: false }
8
7
 
9
8
  def self.included(base)
@@ -11,13 +10,12 @@ module BetfairApiNgRails
11
10
  end
12
11
 
13
12
  module ClassMethods
14
-
15
13
  def attributes(attrs)
16
14
  define_class_attrs attrs
17
15
  define_attr_accessors
18
16
  end
19
17
 
20
- private
18
+ private
21
19
 
22
20
  def define_class_attrs(attrs)
23
21
  class << self; attr_accessor :class_attrs; end
@@ -41,11 +39,9 @@ module BetfairApiNgRails
41
39
  def fetch_attr_options(attrib)
42
40
  attrib.is_a?(Hash) ? DEFAULT_OPTIONS.merge(attrib.values.first) : DEFAULT_OPTIONS
43
41
  end
44
-
45
42
  end
46
-
47
43
  end
48
44
  end
49
45
  end
50
46
  end
51
- end
47
+ end
@@ -6,10 +6,18 @@ module BetfairApiNgRails
6
6
  include BetfairApiNgRails::Api::Data::Constants
7
7
 
8
8
  def to_hash
9
- BetfairApiNgRails::Api::Hashalator.new(attributes_hash).to_hash
9
+ call_hashalator
10
10
  end
11
11
 
12
- private
12
+ def to_param
13
+ call_hashalator true
14
+ end
15
+
16
+ private
17
+
18
+ def call_hashalator(for_param = false)
19
+ BetfairApiNgRails::Api::Hashalator.new(attributes_hash, for_param).to_hash
20
+ end
13
21
 
14
22
  def attributes_hash
15
23
  self.class.to_hash_attrs.each_with_object({}) do |a, h|
@@ -26,9 +34,8 @@ module BetfairApiNgRails
26
34
  def get_attr_key(attrib)
27
35
  attrib.is_a?(Hash) ? attrib.keys.first : attrib
28
36
  end
29
-
30
37
  end
31
38
  end
32
39
  end
33
40
  end
34
- end
41
+ end
@@ -2,10 +2,8 @@ module BetfairApiNgRails
2
2
  module Api
3
3
  module Data
4
4
  module Constants
5
-
6
- ATTRS_AS_IS = [Hash, String, Symbol, Fixnum, NilClass]
7
-
5
+ ATTRS_AS_IS = [Hash, String, Symbol, Fixnum, NilClass, Float]
8
6
  end
9
7
  end
10
8
  end
11
- end
9
+ end
@@ -2,15 +2,13 @@ module BetfairApiNgRails
2
2
  module Api
3
3
  module Data
4
4
  class CountryCodeResult < Api::Data::Base
5
-
6
5
  COUNTRY_CODE_RESULT_ATTRS = [
7
6
  :market_count,
8
7
  :country_code
9
8
  ]
10
9
 
11
10
  attributes COUNTRY_CODE_RESULT_ATTRS
12
-
13
11
  end
14
12
  end
15
13
  end
16
- end
14
+ end
@@ -18,8 +18,7 @@ module BetfairApiNgRails
18
18
  def self.to_hash_attrs
19
19
  EVENT_ATTRS
20
20
  end
21
-
22
21
  end
23
22
  end
24
23
  end
25
- end
24
+ end
@@ -2,15 +2,13 @@ module BetfairApiNgRails
2
2
  module Api
3
3
  module Data
4
4
  class EventResult < Api::Data::Base
5
-
6
5
  EVENT_RESULT_ATTRS = [
7
6
  :market_count,
8
7
  {event: { type: BetfairApiNgRails::Event }}
9
8
  ]
10
9
 
11
10
  attributes EVENT_RESULT_ATTRS
12
-
13
11
  end
14
12
  end
15
13
  end
16
- end
14
+ end
@@ -0,0 +1,22 @@
1
+ module BetfairApiNgRails
2
+ module Api
3
+ module Data
4
+ class LimitOnCloseOrder < Api::Data::Base
5
+ include Api::Data::Concerns::Hashable
6
+
7
+ LIMIT_ON_CLOSE_ORDER_ATTRS = [
8
+ :liability,
9
+ :price
10
+ ]
11
+
12
+ attributes LIMIT_ON_CLOSE_ORDER_ATTRS
13
+
14
+ def self.to_hash_attrs
15
+ LIMIT_ON_CLOSE_ORDER_ATTRS
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+
22
+
@@ -0,0 +1,23 @@
1
+ module BetfairApiNgRails
2
+ module Api
3
+ module Data
4
+ class LimitOrder < Api::Data::Base
5
+ include Api::Data::Concerns::Hashable
6
+
7
+ LIMIT_ORDER_ATTRS = [
8
+ :size,
9
+ :price,
10
+ :persistence_type
11
+ ]
12
+
13
+ attributes LIMIT_ORDER_ATTRS
14
+
15
+ def self.to_hash_attrs
16
+ LIMIT_ORDER_ATTRS
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
22
+
23
+
@@ -2,7 +2,6 @@ module BetfairApiNgRails
2
2
  module Api
3
3
  module Data
4
4
  class MarketBook < Api::Data::Base
5
-
6
5
  MARKET_BOOK_ATTRS = [
7
6
  :market_id,
8
7
  :is_market_data_delayed,
@@ -22,10 +21,9 @@ module BetfairApiNgRails
22
21
  :version,
23
22
  {runners: { type: BetfairApiNgRails::Runner, array: true }}
24
23
  ]
25
-
26
- attributes MARKET_BOOK_ATTRS
27
24
 
25
+ attributes MARKET_BOOK_ATTRS
28
26
  end
29
27
  end
30
28
  end
31
- end
29
+ end
@@ -18,7 +18,8 @@ module BetfairApiNgRails
18
18
  :market_countries,
19
19
  :market_type_codes,
20
20
  :market_start_time,
21
- :with_orders
21
+ :with_orders,
22
+ :market_ids
22
23
  ]
23
24
 
24
25
  attributes MARKET_FILTER_ATTRS
@@ -30,4 +31,4 @@ module BetfairApiNgRails
30
31
  end
31
32
  end
32
33
  end
33
- end
34
+ end
@@ -0,0 +1,20 @@
1
+ module BetfairApiNgRails
2
+ module Api
3
+ module Data
4
+ class MarketOnCloseOrder < Api::Data::Base
5
+ include Api::Data::Concerns::Hashable
6
+
7
+ MARKET_ON_CLOSE_ORDER_ATTRS = [
8
+ :liability
9
+ ]
10
+
11
+ attributes MARKET_ON_CLOSE_ORDER_ATTRS
12
+
13
+ def self.to_hash_attrs
14
+ MARKET_ON_CLOSE_ORDER_ATTRS
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
20
+
@@ -2,7 +2,6 @@ module BetfairApiNgRails
2
2
  module Api
3
3
  module Data
4
4
  class Order < Api::Data::Base
5
-
6
5
  ORDER_ATTRS = [
7
6
  :bet_id,
8
7
  :order_type,
@@ -22,8 +21,7 @@ module BetfairApiNgRails
22
21
  ]
23
22
 
24
23
  attributes ORDER_ATTRS
25
-
26
24
  end
27
25
  end
28
26
  end
29
- end
27
+ end
@@ -0,0 +1,24 @@
1
+ module BetfairApiNgRails
2
+ module Api
3
+ module Data
4
+ class PlaceExecutionReport < Api::Data::Base
5
+ include Api::Data::Concerns::Hashable
6
+
7
+ PLACE_EXECUTION_REPORT_ATTRS = [
8
+ :customer_ref,
9
+ :status,
10
+ :error_code,
11
+ :market_id,
12
+ {instruction_reports: {type: BetfairApiNgRails::PlaceInstructionReport, array: true}}
13
+ ]
14
+
15
+ attributes PLACE_EXECUTION_REPORT_ATTRS
16
+
17
+ def self.to_hash_attrs
18
+ PLACE_EXECUTION_REPORT_ATTRS
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
24
+
@@ -0,0 +1,25 @@
1
+ module BetfairApiNgRails
2
+ module Api
3
+ module Data
4
+ class PlaceInstruction < Api::Data::Base
5
+ include Api::Data::Concerns::Hashable
6
+
7
+ PLACE_INSTRUCTION_ATTRS = [
8
+ :order_type,
9
+ :selection_id,
10
+ :handicap,
11
+ :side,
12
+ { limit_order: { type: BetfairApiNgRails::LimitOrder } },
13
+ { limit_on_close_order: { type: BetfairApiNgRails::LimitOnCloseOrder } },
14
+ { market_on_close_order: { type: BetfairApiNgRails::MarketOnCloseOrder } }
15
+ ]
16
+
17
+ attributes PLACE_INSTRUCTION_ATTRS
18
+
19
+ def self.to_hash_attrs
20
+ PLACE_INSTRUCTION_ATTRS
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,27 @@
1
+ module BetfairApiNgRails
2
+ module Api
3
+ module Data
4
+ class PlaceInstructionReport < Api::Data::Base
5
+ include Api::Data::Concerns::Hashable
6
+
7
+ PLACE_INSTRUCTION_REPORT_ATTRS = [
8
+ :status,
9
+ :error_code,
10
+ {instruction: {type: BetfairApiNgRails::PlaceInstruction}},
11
+ :bet_id,
12
+ :placed_date,
13
+ :average_price_matched,
14
+ :size_matched
15
+ ]
16
+
17
+ attributes PLACE_INSTRUCTION_REPORT_ATTRS
18
+
19
+ def self.to_hash_attrs
20
+ PLACE_INSTRUCTION_REPORT_ATTRS
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+
27
+