Class: SportsManager::TournamentSolution::Serializer
- Extended by:
- Forwardable
- Includes:
- JsonHelper
- Defined in:
- lib/sports_manager/tournament_solution/serializer.rb
Overview
NOTE: Maybe temporary? should each object override as_json?
Instance Attribute Summary collapse
-
#tournament_solution ⇒ Object
readonly
Returns the value of attribute tournament_solution.
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(tournament_solution) ⇒ Serializer
constructor
A new instance of Serializer.
Methods included from JsonHelper
convert_custom_object, convert_value, deep_symbolize_keys
Constructor Details
#initialize(tournament_solution) ⇒ Serializer
Returns a new instance of Serializer.
12 13 14 15 16 |
# File 'lib/sports_manager/tournament_solution/serializer.rb', line 12 def initialize(tournament_solution) @tournament_solution = tournament_solution @tournament = tournament_solution.tournament @solutions = tournament_solution.solutions end |
Instance Attribute Details
#tournament_solution ⇒ Object (readonly)
Returns the value of attribute tournament_solution.
10 11 12 |
# File 'lib/sports_manager/tournament_solution/serializer.rb', line 10 def tournament_solution @tournament_solution end |
Instance Method Details
#as_json ⇒ Object
18 19 20 21 22 23 |
# File 'lib/sports_manager/tournament_solution/serializer.rb', line 18 def as_json(*) { tournament: tournament, solutions: solutions }.as_json end |