Module: StoryTemplates

Included in:
Content
Defined in:
lib/user/content/story_templates.rb

Instance Method Summary collapse

Instance Method Details

#create_story_template(data) ⇒ Object

Create story template.

Create a story template with data.

Parameters

data

(Hash) – Data to be submited.

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)
    return @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

options = {
  "fields": "title"
}
@data = @mints_user.get_story_template(1, options)


60
61
62
# File 'lib/user/content/story_templates.rb', line 60

def get_story_template(id, options = nil)
    return @client.raw("get", "/content/story-templates/#{id}", options)
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)
    return @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

options = {
  "fields": "id, title"
}
@data = @mints_user.get_story_templates(options)


41
42
43
# File 'lib/user/content/story_templates.rb', line 41

def get_story_templates(options = nil)
    return @client.raw("get", "/content/story-templates", options)
end

#get_story_templates_support_dataObject

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
    return @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 submited.

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)
    return @client.raw("put", "/content/story-templates/#{id}", nil, data_transform(data))
end