Class: YFantasy::Api::SubresourceParamBuilder
- Inherits:
-
Object
- Object
- YFantasy::Api::SubresourceParamBuilder
- Defined in:
- lib/y_fantasy/api/subresource_param_builder.rb
Defined Under Namespace
Classes: Error
Constant Summary collapse
- SUBRESOURCE_MAP =
{ draft_results: :draftresults, ownership_percentage: :percent_owned, team_standings: :standings }
- PLAYER_FILTERS =
[ :count, :position, :search, :sort, :sort_type, :start, :status ].freeze
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(subresources = [], **options) ⇒ SubresourceParamBuilder
constructor
A new instance of SubresourceParamBuilder.
Constructor Details
#initialize(subresources = [], **options) ⇒ SubresourceParamBuilder
Returns a new instance of SubresourceParamBuilder.
22 23 24 25 26 27 |
# File 'lib/y_fantasy/api/subresource_param_builder.rb', line 22 def initialize(subresources = [], **) @regular_subs, @nested_subs = normalize_subresources(subresources) @week = .delete(:week) @player_filters = set_player_filters() @options = end |
Instance Method Details
#build ⇒ Object
29 30 31 32 33 34 35 36 37 |
# File 'lib/y_fantasy/api/subresource_param_builder.rb', line 29 def build @params = +"" add_regular_subresource_segments add_nested_subresource_segments add_subresource_keys add_week add_player_filters @params end |