Class: EVSSSeparationLocationSerializer
- Inherits:
-
Object
- Object
- EVSSSeparationLocationSerializer
- Defined in:
- app/serializers/evss_separation_location_serializer.rb
Instance Method Summary collapse
-
#initialize(resource) ⇒ EVSSSeparationLocationSerializer
constructor
A new instance of EVSSSeparationLocationSerializer.
- #serializable_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(resource) ⇒ EVSSSeparationLocationSerializer
Returns a new instance of EVSSSeparationLocationSerializer.
4 5 6 |
# File 'app/serializers/evss_separation_location_serializer.rb', line 4 def initialize(resource) @resource = resource end |
Instance Method Details
#serializable_hash ⇒ Object
12 13 14 15 16 17 |
# File 'app/serializers/evss_separation_location_serializer.rb', line 12 def serializable_hash { status: @resource.status, separation_locations: @resource.separation_locations } end |
#to_json ⇒ Object
8 9 10 |
# File 'app/serializers/evss_separation_location_serializer.rb', line 8 def to_json(*) Oj.dump(serializable_hash, mode: :compat, time_format: :ruby) end |