Module: StoryTemplates
- Included in:
- Content
- Defined in:
- lib/user/content/story_templates.rb
Instance Method Summary collapse
-
#create_story_template(data) ⇒ Object
Create story template.
-
#get_story_template(id, options = nil) ⇒ Object
Get story template.
-
#get_story_template_support_data(id) ⇒ Object
Get support data of story template.
-
#get_story_templates(options = nil) ⇒ Object
Get story templates.
-
#get_story_templates_support_data ⇒ Object
Get support data of story templates.
-
#update_story_template(id, data) ⇒ Object
Update story template.
Instance Method Details
#create_story_template(data) ⇒ Object
Create story template.
Create a story template with data.
Parameters
- data
-
(Hash) – Data to be submitted.
Example
data = {
"title": "New Story Template",
"slug": "new-story-template-slug"
}
@data = @mints_user.create_story_template(data)
76 77 78 |
# File 'lib/user/content/story_templates.rb', line 76 def create_story_template(data) @client.raw("post", "/content/story-templates", nil, data_transform(data)) end |
#get_story_template(id, options = nil) ⇒ Object
Get story template.
Get a story template info.
Parameters
- id
-
(Integer) – Story template id.
- options
-
(Hash) – List of Resource Collection Options shown above can be used as parameter.
First Example
@data = @mints_user.get_story_template(2)
Second Example
= {
"fields": "title"
}
@data = @mints_user.get_story_template(1, )
60 61 62 |
# File 'lib/user/content/story_templates.rb', line 60 def get_story_template(id, = nil) @client.raw("get", "/content/story-templates/#{id}", ) end |
#get_story_template_support_data(id) ⇒ Object
Get support data of story template.
Get support data used in a story template.
Parameters
- id
-
(Integer) – Story template id.
Example
@data = @mints_user.get_story_template_support_data(1)
14 15 16 |
# File 'lib/user/content/story_templates.rb', line 14 def get_story_template_support_data(id) @client.raw("get", "/content/story-templates/support-data/stories/#{id}") end |
#get_story_templates(options = nil) ⇒ Object
Get story templates.
Get a collection of story templates.
Parameters
- options
-
(Hash) – List of Resource Collection Options shown above can be used as parameter.
First Example
@data = @mints_user.get_story_templates
Second Example
= {
"fields": "id, title"
}
@data = @mints_user.get_story_templates()
41 42 43 |
# File 'lib/user/content/story_templates.rb', line 41 def get_story_templates( = nil) @client.raw("get", "/content/story-templates", ) end |
#get_story_templates_support_data ⇒ Object
Get support data of story templates.
Get support data used in story templates.
Example
@data = @mints_user.get_story_templates_support_data
23 24 25 |
# File 'lib/user/content/story_templates.rb', line 23 def get_story_templates_support_data @client.raw("get", "/content/story-templates/support-data") end |
#update_story_template(id, data) ⇒ Object
Update story template.
Update a story template info.
Parameters
- id
-
(Integer) – Story template id.
- data
-
(Hash) – Data to be submitted.
Example
data = {
"title": "New Story Template Modified"
}
@data = @mints_user.update_story_template(3, data)
92 93 94 |
# File 'lib/user/content/story_templates.rb', line 92 def update_story_template(id, data) @client.raw("put", "/content/story-templates/#{id}", nil, data_transform(data)) end |