Module: LatoBlog::Post::SerializerHelpers
- Included in:
- LatoBlog::Post
- Defined in:
- app/models/lato_blog/post/serializer_helpers.rb
Instance Method Summary collapse
-
#serialize ⇒ Object
This function serializes a complete version of the post.
-
#serialize_base ⇒ Object
This function serializes a basic version of the post.
Instance Method Details
#serialize ⇒ Object
This function serializes a complete version of the post.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'app/models/lato_blog/post/serializer_helpers.rb', line 5 def serialize serialized = {} # set basic info serialized[:id] = id serialized[:title] = title serialized[:subtitle] = subtitle serialized[:excerpt] = excerpt serialized[:content] = content serialized[:seo_description] = seo_description serialized[:meta_language] = serialized[:meta_permalink] = serialized[:meta_status] = # add fields informations serialized[:fields] = serialize_fields # add categories informations serialized[:categories] = serialize_categories # add tags informations serialized[:tags] = # add post parent informations serialized[:other_informations] = serialize_other_informations # return serialized post serialized end |
#serialize_base ⇒ Object
This function serializes a basic version of the post.
36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'app/models/lato_blog/post/serializer_helpers.rb', line 36 def serialize_base serialized = {} # set basic info serialized[:id] = id serialized[:title] = title serialized[:meta_language] = serialized[:meta_permalink] = serialized[:meta_status] = # return serialized post serialized end |