Sha256: 76bbfc09e12f657524952c38c7af87d4d03ef223378f7be9c665ecb886374a8e

Contents?: true

Size: 596 Bytes

Versions: 7

Compression:

Stored size: 596 Bytes

Contents

require 'jbuilder'

class Api::PostsApi < Api::BaseApi

  def v1(posts)

    Jbuilder.encode do |json|

      json.api_version 'v1'
    	
      json.posts posts do |json, post|
        timestamps json, post      
        json.name post.name
        json.content post.content
      end

    end
    
  end

  def v1_1(posts)

    Jbuilder.encode do |json|
      
      json.api_version 'v1_1'

      json.posts posts do |json, post|
        timestamps json, post      
        json.name post.name
        json.teaser post.teaser
        json.content post.content
      end

    end
    
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
api_versioning-0.0.7 test/dummy/app/models/api/posts_api.rb
api_versioning-0.0.6 test/dummy/app/models/api/posts_api.rb
api_versioning-0.0.5 test/dummy/app/models/api/posts_api.rb
api_versioning-0.0.4 test/dummy/app/models/api/posts_api.rb
api_versioning-0.0.3 test/dummy/app/models/api/posts_api.rb
api_versioning-0.0.2 test/dummy/app/models/api/posts_api.rb
api_versioning-0.0.1 test/dummy/app/models/api/posts_api.rb