Class: WorldDb::Model::CountrySerializer
- Inherits:
-
Object
- Object
- WorldDb::Model::CountrySerializer
- Defined in:
- lib/worlddb/serializers/country.rb
Overview
todo/check:
add as_row to CityBase for all classes - why? why not??
Instance Attribute Summary collapse
-
#country ⇒ Object
readonly
Returns the value of attribute country.
Instance Method Summary collapse
- #as_row ⇒ Object
-
#initialize(country) ⇒ CountrySerializer
constructor
A new instance of CountrySerializer.
Constructor Details
#initialize(country) ⇒ CountrySerializer
Returns a new instance of CountrySerializer.
11 12 13 |
# File 'lib/worlddb/serializers/country.rb', line 11 def initialize( country ) @country = country end |
Instance Attribute Details
#country ⇒ Object (readonly)
Returns the value of attribute country.
15 16 17 |
# File 'lib/worlddb/serializers/country.rb', line 15 def country @country end |
Instance Method Details
#as_row ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/worlddb/serializers/country.rb', line 17 def as_row ## todo: add tags too?? data = { key: country.key, name: country.name, code: country.code, pop: country.pop, area: country.area, synonyms: country.synonyms } data end |