Class: AddressSerializer

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

Instance Method Summary collapse

Instance Method Details

#countryObject



7
8
9
# File 'app/serializers/address_serializer.rb', line 7

def country
  object.country.try(:iso)
end

#stateObject



11
12
13
14
15
16
17
# File 'app/serializers/address_serializer.rb', line 11

def state
  if object.state
    object.state.abbr
  else
    object.state_name
  end
end