Class: ObservationSerializer

Inherits:
ActiveModel::Serializer
  • Object
show all
Defined in:
app/serializers/observation_serializer.rb

Overview

Emits observations as JSON

Instance Method Summary collapse

Instance Method Details

#attributesObject


5
6
7
8
9
10
# File 'app/serializers/observation_serializer.rb', line 5

def attributes
  data = super
  data[:created_at] = object.created_at_local.iso8601
  data[:tstamp] = object.created_at_local.to_i
  data
end