Class: Pumi::ResponseSerializer
- Inherits:
-
Object
- Object
- Pumi::ResponseSerializer
- Defined in:
- app/serializers/pumi/response_serializer.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(data) ⇒ ResponseSerializer
constructor
A new instance of ResponseSerializer.
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
#data ⇒ Object (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_json ⇒ Object
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 |