Class: Pumi::ResponseSerializer

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ ResponseSerializer

Returns a new instance of ResponseSerializer.



5
6
7
# File 'app/serializers/pumi/response_serializer.rb', line 5

def initialize(data)
  @data = data
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



3
4
5
# File 'app/serializers/pumi/response_serializer.rb', line 3

def data
  @data
end

Instance Method Details

#as_jsonObject



9
10
11
12
13
# File 'app/serializers/pumi/response_serializer.rb', line 9

def as_json(*)
  data.map do |location|
    location.attributes.except(:province, :district, :commune, :village)
  end
end