class GatherContent::Api::Templates
Attributes
project_id[RW]
Public Class Methods
new(project_id)
click to toggle source
# File lib/gather_content/api/templates.rb, line 7 def initialize(project_id) raise ArgumentError, "project_id is required!" if project_id.nil? @project_id = project_id end
Public Instance Methods
each() { |template| ... }
click to toggle source
# File lib/gather_content/api/templates.rb, line 12 def each(&block) fetch.each do |template| yield GatherContent::Api::Template.new(template['id'], template) end end
Private Instance Methods
params()
click to toggle source
# File lib/gather_content/api/templates.rb, line 20 def params { project_id: @project_id } end
path()
click to toggle source
# File lib/gather_content/api/templates.rb, line 24 def path @path ||= '/templates' end
valid_type?(type)
click to toggle source
# File lib/gather_content/api/templates.rb, line 28 def valid_type?(type) return type = "other" if type.nil? || type.empty? types = %w{website-build ongoing-website-content marketing-editorial-content email-marketing-content other} types.include?(type) end