Class: EVSSSeparationLocationSerializer

Inherits:
Object
  • Object
show all
Defined in:
app/serializers/evss_separation_location_serializer.rb

Instance Method Summary collapse

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_hashObject



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_jsonObject



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