Class: IssueSerializer
- Inherits:
-
BaseSerializer
- Object
- BaseSerializer
- IssueSerializer
- Defined in:
- app/serializers/issue_serializer.rb
Instance Attribute Summary
Attributes inherited from BaseSerializer
Instance Method Summary collapse
-
#represent(issue, opts = {}) ⇒ Object
This overrided method takes care of which entity should be used to serialize the `issue` based on `serializer` key in `opts` param.
Methods inherited from BaseSerializer
Constructor Details
This class inherits a constructor from BaseSerializer
Instance Method Details
#represent(issue, opts = {}) ⇒ Object
This overrided method takes care of which entity should be used to serialize the `issue` based on `serializer` key in `opts` param. Hence, `entity` doesn't need to be declared on the class scope.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'app/serializers/issue_serializer.rb', line 7 def represent(issue, opts = {}) entity = case opts[:serializer] when 'sidebar' IssueSidebarBasicEntity when 'sidebar_extras' IssueSidebarExtrasEntity when 'board' IssueBoardEntity else IssueEntity end super(issue, opts, entity) end |