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.
- checksums.yaml +4 -4
- data/README.md +26 -1
- data/Rakefile +8 -8
- data/betfair_api_ng_rails.gemspec +12 -7
- data/lib/betfair_api_ng_rails.rb +162 -98
- data/lib/betfair_api_ng_rails/account.rb +4 -0
- data/lib/betfair_api_ng_rails/account_manager.rb +36 -0
- data/lib/betfair_api_ng_rails/account_session.rb +5 -0
- data/lib/betfair_api_ng_rails/account_session_manager.rb +29 -0
- data/lib/betfair_api_ng_rails/api/caching/helper.rb +34 -0
- data/lib/betfair_api_ng_rails/api/caching/response_cache.rb +57 -0
- data/lib/betfair_api_ng_rails/api/concerns/errorable.rb +1 -3
- data/lib/betfair_api_ng_rails/api/config.rb +20 -8
- data/lib/betfair_api_ng_rails/api/connection.rb +28 -10
- data/lib/betfair_api_ng_rails/api/connection_ext/caching.rb +60 -0
- data/lib/betfair_api_ng_rails/api/connection_ext/error_handling.rb +5 -1
- data/lib/betfair_api_ng_rails/api/connection_ext/logging.rb +34 -0
- data/lib/betfair_api_ng_rails/api/connection_ext/parsing.rb +2 -4
- data/lib/betfair_api_ng_rails/api/connection_ext/ssoid_refreshing.rb +40 -0
- data/lib/betfair_api_ng_rails/api/constants.rb +39 -18
- data/lib/betfair_api_ng_rails/api/data/account_details_response.rb +27 -0
- data/lib/betfair_api_ng_rails/api/data/account_funds_response.rb +26 -0
- data/lib/betfair_api_ng_rails/api/data/account_statement_report.rb +17 -0
- data/lib/betfair_api_ng_rails/api/data/competition.rb +3 -4
- data/lib/betfair_api_ng_rails/api/data/competition_result.rb +1 -3
- data/lib/betfair_api_ng_rails/api/data/concerns/attributable.rb +2 -6
- data/lib/betfair_api_ng_rails/api/data/concerns/hashable.rb +11 -4
- data/lib/betfair_api_ng_rails/api/data/constants.rb +2 -4
- data/lib/betfair_api_ng_rails/api/data/country_code_result.rb +1 -3
- data/lib/betfair_api_ng_rails/api/data/event.rb +1 -2
- data/lib/betfair_api_ng_rails/api/data/event_result.rb +1 -3
- data/lib/betfair_api_ng_rails/api/data/limit_on_close_order.rb +22 -0
- data/lib/betfair_api_ng_rails/api/data/limit_order.rb +23 -0
- data/lib/betfair_api_ng_rails/api/data/market_book.rb +2 -4
- data/lib/betfair_api_ng_rails/api/data/market_filter.rb +3 -2
- data/lib/betfair_api_ng_rails/api/data/market_on_close_order.rb +20 -0
- data/lib/betfair_api_ng_rails/api/data/order.rb +1 -3
- data/lib/betfair_api_ng_rails/api/data/place_execution_report.rb +24 -0
- data/lib/betfair_api_ng_rails/api/data/place_instruction.rb +25 -0
- data/lib/betfair_api_ng_rails/api/data/place_instruction_report.rb +27 -0
- data/lib/betfair_api_ng_rails/api/data/statement_item.rb +30 -0
- data/lib/betfair_api_ng_rails/api/data/statement_legacy_data.rb +40 -0
- data/lib/betfair_api_ng_rails/api/endpoint_factory.rb +21 -0
- data/lib/betfair_api_ng_rails/api/endpoints/australian.rb +17 -0
- data/lib/betfair_api_ng_rails/api/endpoints/base.rb +42 -0
- data/lib/betfair_api_ng_rails/api/endpoints/italian.rb +17 -0
- data/lib/betfair_api_ng_rails/api/endpoints/spanish.rb +17 -0
- data/lib/betfair_api_ng_rails/api/endpoints/uk.rb +17 -0
- data/lib/betfair_api_ng_rails/api/enums/execution_report_error_code.rb +22 -1
- data/lib/betfair_api_ng_rails/api/enums/execution_report_status.rb +12 -1
- data/lib/betfair_api_ng_rails/api/enums/include_item.rb +23 -0
- data/lib/betfair_api_ng_rails/api/enums/instruction_report_error_code.rb +25 -1
- data/lib/betfair_api_ng_rails/api/enums/instruction_report_status.rb +8 -1
- data/lib/betfair_api_ng_rails/api/enums/item_class.rb +19 -0
- data/lib/betfair_api_ng_rails/api/enums/order_status.rb +7 -1
- data/lib/betfair_api_ng_rails/api/enums/order_type.rb +11 -2
- data/lib/betfair_api_ng_rails/api/enums/persistence_type.rb +8 -1
- data/lib/betfair_api_ng_rails/api/enums/side.rb +7 -2
- data/lib/betfair_api_ng_rails/api/enums/wallet.rb +20 -0
- data/lib/betfair_api_ng_rails/api/formatter_factory.rb +2 -4
- data/lib/betfair_api_ng_rails/api/formatters/js_tree_formatter.rb +2 -4
- data/lib/betfair_api_ng_rails/api/hashalator.rb +6 -6
- data/lib/betfair_api_ng_rails/api/helper.rb +2 -4
- data/lib/betfair_api_ng_rails/api/http/factory.rb +19 -14
- data/lib/betfair_api_ng_rails/api/http/helpers/information_response.rb +2 -4
- data/lib/betfair_api_ng_rails/api/http/helpers/keep_alive_response.rb +3 -4
- data/lib/betfair_api_ng_rails/api/http/helpers/session_response.rb +3 -4
- data/lib/betfair_api_ng_rails/api/http/proxy_requester.rb +87 -0
- data/lib/betfair_api_ng_rails/api/http/requester.rb +3 -3
- data/lib/betfair_api_ng_rails/api/http/responser.rb +4 -3
- data/lib/betfair_api_ng_rails/api/invalid_endpoint_error.rb +6 -0
- data/lib/betfair_api_ng_rails/api/logs/console_logger.rb +13 -0
- data/lib/betfair_api_ng_rails/api/logs/file_logger.rb +23 -0
- data/lib/betfair_api_ng_rails/api/parsers/base.rb +14 -6
- data/lib/betfair_api_ng_rails/api/parsers/get_account_details.rb +13 -0
- data/lib/betfair_api_ng_rails/api/parsers/get_account_funds.rb +14 -0
- data/lib/betfair_api_ng_rails/api/parsers/get_account_statement.rb +15 -0
- data/lib/betfair_api_ng_rails/api/parsers/list_base.rb +18 -0
- data/lib/betfair_api_ng_rails/api/parsers/list_competitions.rb +5 -7
- data/lib/betfair_api_ng_rails/api/parsers/list_countries.rb +5 -7
- data/lib/betfair_api_ng_rails/api/parsers/list_event_types.rb +5 -7
- data/lib/betfair_api_ng_rails/api/parsers/list_events.rb +5 -7
- data/lib/betfair_api_ng_rails/api/parsers/list_market_book.rb +5 -7
- data/lib/betfair_api_ng_rails/api/parsers/list_market_catalogue.rb +5 -7
- data/lib/betfair_api_ng_rails/api/parsers/list_market_types.rb +5 -7
- data/lib/betfair_api_ng_rails/api/parsers/list_time_ranges.rb +5 -7
- data/lib/betfair_api_ng_rails/api/parsers/list_venues.rb +5 -7
- data/lib/betfair_api_ng_rails/api/parsers/place_orders.rb +14 -0
- data/lib/betfair_api_ng_rails/api/parsers/single_base.rb +19 -0
- data/lib/betfair_api_ng_rails/api/provider.rb +11 -14
- data/lib/betfair_api_ng_rails/api/request_method.rb +43 -0
- data/lib/betfair_api_ng_rails/api/request_methods/account.rb +51 -0
- data/lib/betfair_api_ng_rails/api/request_methods/all.rb +26 -0
- data/lib/betfair_api_ng_rails/api/request_methods/betting.rb +30 -0
- data/lib/betfair_api_ng_rails/api/session_manager.rb +34 -31
- data/lib/betfair_api_ng_rails/bad_response_error.rb +4 -0
- data/lib/betfair_api_ng_rails/errors.rb +3 -2
- data/lib/betfair_api_ng_rails/railtie.rb +7 -2
- data/lib/betfair_api_ng_rails/version.rb +1 -1
- data/lib/generators/betfair_api_ng_rails/install/templates/betfair_api_ng_rails.rb +20 -11
- data/lib/generators/betfair_api_ng_rails/install/templates/betfair_api_ng_rails.yml +5 -7
- data/spec/lib/betfair_api_ng_rails/account_manager_spec.rb +76 -0
- data/spec/lib/betfair_api_ng_rails/account_session_manager_spec.rb +59 -0
- data/spec/lib/betfair_api_ng_rails/account_session_spec.rb +13 -0
- data/spec/lib/betfair_api_ng_rails/account_spec.rb +18 -0
- data/spec/lib/betfair_api_ng_rails/api/caching/helper_spec.rb +89 -0
- data/spec/lib/betfair_api_ng_rails/api/caching/response_cache_spec.rb +131 -0
- data/spec/lib/betfair_api_ng_rails/api/config_spec.rb +37 -0
- data/spec/lib/betfair_api_ng_rails/api/connection_spec.rb +99 -0
- data/spec/lib/betfair_api_ng_rails/api/data/account_statement_report_spec.rb +11 -0
- data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/competition_result_spec.rb +0 -0
- data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/competition_spec.rb +0 -0
- data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/concerns/attributable_spec.rb +0 -0
- data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/concerns/hashable_spec.rb +16 -32
- data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/concerns/jsonable_spec.rb +0 -0
- data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/country_code_result_spec.rb +0 -0
- data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/event_result_spec.rb +0 -0
- data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/event_spec.rb +0 -0
- data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/event_type_result_spec.rb +0 -0
- data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/event_type_spec.rb +0 -0
- data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/ex_best_offers_overrides_spec.rb +0 -0
- data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/exchange_prices_spec.rb +0 -0
- data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/market_book_spec.rb +1 -6
- data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/market_catalogue_spec.rb +0 -0
- data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/market_description_spec.rb +0 -0
- data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/market_filter_spec.rb +0 -0
- data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/market_type_result_spec.rb +0 -0
- data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/match_spec.rb +0 -0
- data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/order_spec.rb +0 -0
- data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/price_projection_spec.rb +0 -0
- data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/price_size_spec.rb +0 -0
- data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/runner_catalog_spec.rb +0 -0
- data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/runner_spec.rb +0 -0
- data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/starting_prices_spec.rb +0 -0
- data/spec/lib/betfair_api_ng_rails/api/data/statement_item_spec.rb +9 -0
- data/spec/lib/betfair_api_ng_rails/api/data/statement_legacy_data_spec.rb +6 -0
- data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/time_range_result_spec.rb +0 -0
- data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/time_range_spec.rb +1 -3
- data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/venue_result_spec.rb +0 -0
- data/spec/lib/betfair_api_ng_rails/api/endpoint_factory_spec.rb +27 -0
- data/spec/lib/betfair_api_ng_rails/api/endpoints/australian_spec.rb +6 -0
- data/spec/lib/betfair_api_ng_rails/api/endpoints/base_spec.rb +5 -0
- data/spec/lib/betfair_api_ng_rails/api/endpoints/italian_spec.rb +6 -0
- data/spec/lib/betfair_api_ng_rails/api/endpoints/spanish_spec.rb +7 -0
- data/spec/lib/betfair_api_ng_rails/api/endpoints/uk_spec.rb +6 -0
- data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/formatters/js_tree_formatter_spec.rb +0 -0
- data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/hashalator_spec.rb +27 -46
- data/spec/lib/betfair_api_ng_rails/api/http/factory_spec.rb +40 -0
- data/spec/lib/betfair_api_ng_rails/api/logs/console_logger_spec.rb +18 -0
- data/spec/lib/betfair_api_ng_rails/api/logs/file_logger_spec.rb +33 -0
- data/spec/lib/betfair_api_ng_rails/api/provider_spec.rb +53 -0
- data/spec/lib/betfair_api_ng_rails/api/request_method_spec.rb +38 -0
- data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/request_methods_spec.rb +47 -32
- data/spec/lib/betfair_api_ng_rails/api/session_manager_spec.rb +77 -0
- data/spec/lib/betfair_api_ng_rails/integration/get_account_statement_spec.rb +57 -0
- data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/integration/list_competitions_spec.rb +7 -9
- data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/integration/list_countries_spec.rb +7 -9
- data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/integration/list_event_types_spec.rb +7 -9
- data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/integration/list_events_spec.rb +7 -9
- data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/integration/list_market_book_spec.rb +7 -9
- data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/integration/list_market_catalogue_spec.rb +7 -16
- data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/integration/list_market_types_spec.rb +7 -9
- data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/integration/list_time_ranges_spec.rb +7 -9
- data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/integration/list_venues_spec.rb +7 -9
- data/spec/lib/betfair_api_ng_rails/integration/place_orders_spec.rb +55 -0
- data/spec/spec_helper.rb +9 -1
- data/spec/support/base_yaml_loader.rb +2 -4
- data/spec/support/data/models.yml +37 -1
- data/spec/support/data_models_yaml_loader.rb +1 -3
- data/spec/support/have_attr_accessor.rb +18 -0
- data/spec/support/helper.rb +1 -3
- data/spec/support/shared_examples/base_endpoint.rb +5 -0
- data/spec/support/shared_examples/concrete_endpoint.rb +28 -0
- data/spec/support/shared_examples/data_model.rb +2 -11
- data/spec/support/shared_examples/request_method.rb +5 -8
- data/spec/support/shared_examples/simple_list_filtering_request.rb +10 -19
- metadata +252 -117
- data/lib/betfair_api_ng_rails/api/request_methods.rb +0 -41
- data/spec/betfair_api_ng_rails/api/connection_spec.rb +0 -76
- data/spec/betfair_api_ng_rails/api/provider_spec.rb +0 -91
- 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
|
@@ -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
|
-
|
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
|
-
|
9
|
+
call_hashalator
|
10
10
|
end
|
11
11
|
|
12
|
-
|
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,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
|
@@ -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
|
+
|
@@ -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
|
+
|