Sha256: 03441c239b0f56bb11d0c38bb9ebc94664c123d4481e9278ba75f229ca625118
Contents?: true
Size: 654 Bytes
Versions: 1
Compression:
Stored size: 654 Bytes
Contents
module Wordsmith class Template attr_reader :name, :slug, :project def initialize(name: nil, slug: nil, project: nil, **attributes) raise 'Missing required keyword arguments' unless [name, slug, project].all? @name = name @slug = slug @project = project end def generate(data, proofread: false) Wordsmith.client.post(path('outputs'), data, proofread: proofread) end def test(data, proofread: false) Wordsmith.client.post(path('test'), data, proofread: proofread) end private def path(endpoint) "projects/#{project.slug}/templates/#{slug}/#{endpoint}" end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
wordsmith-ruby-sdk-2.0.0 | lib/wordsmith/template.rb |