Module: Twirly::Serializers::Post

Included in:
Post
Defined in:
lib/twirly/serializers/post.rb

Instance Method Summary collapse

Instance Method Details

#as_jsonObject



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/twirly/serializers/post.rb', line 4

def as_json
  { post: {
      card_id:       card_id,
      title:         title,
      category:      category,
      tags:          tags,
      updated_at:    updated_at,
      published_at:  published_at
    }
  }
end

#to_jsonObject



16
17
18
# File 'lib/twirly/serializers/post.rb', line 16

def to_json
  as_json.to_json
end