Commit 1326b81d authored by sergio1990's avatar sergio1990

Using locale from config by default

parent 2037936f
......@@ -8,17 +8,17 @@ module BetfairApiNgRails
SIMPLE_LISTING_FILTERED.each do |method|
eval <<-CODE
def #{method.underscore}(filter: Api::Data::MarketFilter.new, locale: :en)
def #{method.underscore}(filter: Api::Data::MarketFilter.new, locale: BetfairApiNgRails.config.locale)
run_request __method__, { filter: filter }, { locale: locale }
end
CODE
end
def list_market_catalogue(filter: MarketFilter.new, market_projection: [], sort: "", max_results: '1', locale: :en)
def list_market_catalogue(filter: MarketFilter.new, market_projection: [], sort: "", max_results: '1', locale: BetfairApiNgRails.config.locale)
run_request __method__, { filter: filter, market_projection: market_projection, sort: sort, max_results: max_results }, { locale: locale }
end
def list_market_book(market_ids: [], price_projection: BetfairApiNgRails::PriceProjection.new, order_projection: '', match_projection: '', currency_code: 'USD', locale: :en)
def list_market_book(market_ids: [], price_projection: BetfairApiNgRails::PriceProjection.new, order_projection: '', match_projection: '', currency_code: 'USD', locale: BetfairApiNgRails.config.locale)
run_request __method__, { market_ids: market_ids, price_projection: price_projection, order_projection: order_projection, match_projection: match_projection }, { currency_code: currency_code, locale: locale }
end
......
......@@ -6,6 +6,8 @@ module TestModule
end
describe BetfairApiNgRails::Api::RequestMethods do
before { BetfairApiNgRails.config.locale = :en }
BetfairApiNgRails::Api::Constants::SIMPLE_LISTING_FILTERED.each do |method|
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment