Module: LatoBlog::Category::SerializerHelpers
- Included in:
- LatoBlog::Category
- Defined in:
- app/models/lato_blog/category/serializer_helpers.rb
Instance Method Summary collapse
-
#serialize ⇒ Object
This function serializes a complete version of the category.
-
#serialize_base ⇒ Object
This function serializes a basic version of the category.
Instance Method Details
#serialize ⇒ Object
This function serializes a complete version of the category.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'app/models/lato_blog/category/serializer_helpers.rb', line 5 def serialize serialized = {} # set basic info serialized[:id] = id serialized[:title] = title serialized[:meta_language] = serialized[:meta_permalink] = # add category father informations serialized[:category_father] = category_father ? category_father.serialize_base : nil # add category children informations serialized[:category_children] = serialize_category_children # add category parent informations serialized[:other_informations] = serialize_other_informations # return serialized post serialized end |
#serialize_base ⇒ Object
This function serializes a basic version of the category.
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'app/models/lato_blog/category/serializer_helpers.rb', line 28 def serialize_base serialized = {} # set basic info serialized[:id] = id serialized[:title] = title serialized[:meta_language] = serialized[:meta_permalink] = # return serialized category serialized end |