Module: PublicStoryVersions

Included in:
PublicContent
Defined in:
lib/pub/content/story_versions.rb

Instance Method Summary collapse

Instance Method Details

#get_story_version(slug, options = nil) ⇒ Object

Get Story Version.

Get a single story version.

Parameters

slug

(String) – It’s the string identifier generated by Mints.

options

(Hash) – List of Single Resource Options shown above can be used as parameter.

First Example

@data = @mints_pub.get_story_version('story_slug')

Second Example

@data = @mints_pub.get_story_version('story_slug', options)


43
44
45
# File 'lib/pub/content/story_versions.rb', line 43

def get_story_version(slug, options = nil)
  @client.raw('get', "/content/story-versions/#{slug}", options)
end

#get_story_versions(options = nil, use_post = true) ⇒ Object

Get Story Versions.

Get a collection of story version.

Parameters

options

(Hash) – List of Resource collection Options shown above can be used as parameter.

use_post

(Boolean) – Variable to determine if the request is by ‘post’ or ‘get’ functions.

First Example

@data = @mints_pub.get_story_versions

Second Example

options = {
  fields: 'id, title'
}
@data = @mints_pub.get_story_versions(options)

Third Example

options = {
  fields: 'id, title'
}
@data = @mints_pub.get_story_versions(options, false)


26
27
28
# File 'lib/pub/content/story_versions.rb', line 26

def get_story_versions(options = nil, use_post = true)
  get_query_results('/content/story-versions', options, use_post)
end