Sha256: e2b74aeff48c57a5a91f79752ef7dd0fe91888a8da13c6e4f6d6c60682d9e47b

Contents?: true

Size: 820 Bytes

Versions: 6

Compression:

Stored size: 820 Bytes

Contents

require 'seek/sample_templates/column'
require 'seek/sample_templates/generator'

module Seek
  # Main entry point for generating templates
  module SampleTemplates
    # generates a template at the specific path
    def self.generate(sheet_name, sheet_index, columns, base_template_path, output_path)
      Seek::SampleTemplates::Generator.new(
          output_path, create_json(sheet_name,sheet_index,columns,base_template_path)
      ).generate
    end

    def self.create_json(sheet_name,sheet_index,columns,base_template_path)
      definition = { sheet_name: sheet_name,
        sheet_index: sheet_index,
        columns: columns.collect(&:as_json) }
      definition[:base_template_path]=base_template_path if base_template_path
      definition.to_json
    end

    private_class_method :create_json
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sample-template-generator-0.7.1 lib/seek/sample_templates.rb
sample-template-generator-0.7.0 lib/seek/sample_templates.rb
sample-template-generator-0.6.0 lib/seek/sample_templates.rb
sample-template-generator-0.5.1 lib/seek/sample_templates.rb
sample-template-generator-0.5.0 lib/seek/sample_templates.rb
sample-template-generator-0.4.1 lib/seek/sample_templates.rb