Class: Stattleship::Params::QueryParams
- Inherits:
-
Object
- Object
- Stattleship::Params::QueryParams
- Defined in:
- lib/stattleship/params/query_params.rb
Direct Known Subclasses
GameTimeParams, InjuriesParams, PlayersParams, RankingsParams, StatLeadersParams, TeamOutcomeStreaksParams, TeamsParams, TopStatsParams
Instance Attribute Summary collapse
-
#page ⇒ Object
Returns the value of attribute page.
-
#per_page ⇒ Object
Returns the value of attribute per_page.
-
#season_id ⇒ Object
Returns the value of attribute season_id.
Instance Method Summary collapse
Instance Attribute Details
#page ⇒ Object
Returns the value of attribute page.
4 5 6 |
# File 'lib/stattleship/params/query_params.rb', line 4 def page @page end |
#per_page ⇒ Object
Returns the value of attribute per_page.
4 5 6 |
# File 'lib/stattleship/params/query_params.rb', line 4 def per_page @per_page end |
#season_id ⇒ Object
Returns the value of attribute season_id.
4 5 6 |
# File 'lib/stattleship/params/query_params.rb', line 4 def season_id @season_id end |
Instance Method Details
#params ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/stattleship/params/query_params.rb', line 6 def params { 'page' => page, 'per_page' => per_page, 'season_id' => season_id, } end |
#query ⇒ Object
14 15 16 |
# File 'lib/stattleship/params/query_params.rb', line 14 def query { 'query' => validate } end |
#validate ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/stattleship/params/query_params.rb', line 18 def validate query_parameters.keys.each do |key| validator(key).new(key: key, params: query_parameters, class_name: self.class.name). validate end query_parameters end |