Module: PublicStories
- Included in:
- PublicContent
- Defined in:
- lib/pub/content/stories.rb
Instance Method Summary collapse
-
#get_stories(options = nil, use_post = true) ⇒ Object
Get Stories.
-
#get_story(slug, options = nil) ⇒ Object
Get Story.
Instance Method Details
#get_stories(options = nil, use_post = true) ⇒ Object
Get Stories.
Get a collection of stories.
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_stories
Second Example
= { fields: 'id, slug' }
@data = @mints_pub.get_stories()
Third Example
= {
fields: 'id, slug'
}
@data = @mints_pub.get_stories(, false)
24 25 26 |
# File 'lib/pub/content/stories.rb', line 24 def get_stories( = nil, use_post = true) get_query_results('/content/stories', , use_post) end |
#get_story(slug, options = nil) ⇒ Object
Get Story.
Get a single story.
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("story_slug")
Second Example
@data = @mints_pub.get_story("story_slug", .to_json)
41 42 43 |
# File 'lib/pub/content/stories.rb', line 41 def get_story(slug, = nil) @client.raw('get', "/content/stories/#{slug}", ) end |