Class: Seek::SampleTemplates::Generator

Inherits:
Object
  • Object
show all
Defined in:
lib/seek/sample_templates/generator.rb

Overview

Generator class for creating templates. Generally this shouldn’t be used directly, but instead should be used through Seek::SampleTemplates.generate(..)

Constant Summary collapse

JAR_VERSION =
'0.3'.freeze
JAR_PATH =
File.dirname(__FILE__) +
"/../../../jars/sample-template-generator-#{JAR_VERSION}.jar"
DEFAULT_MEMORY_ALLOCATION =
'512M'.freeze
BUFFER_SIZE =

1/4 a megabyte

250_000

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, json, memory_allocation = DEFAULT_MEMORY_ALLOCATION) ⇒ Generator

Returns a new instance of Generator.



18
19
20
21
22
# File 'lib/seek/sample_templates/generator.rb', line 18

def initialize(path, json, memory_allocation = DEFAULT_MEMORY_ALLOCATION)
  @path = path
  @json = json
  @memory_allocation = memory_allocation
end

Instance Attribute Details

#jsonObject (readonly)

Returns the value of attribute json.



16
17
18
# File 'lib/seek/sample_templates/generator.rb', line 16

def json
  @json
end

#memory_allocationObject (readonly)

Returns the value of attribute memory_allocation.



16
17
18
# File 'lib/seek/sample_templates/generator.rb', line 16

def memory_allocation
  @memory_allocation
end

#pathObject (readonly)

Returns the value of attribute path.



16
17
18
# File 'lib/seek/sample_templates/generator.rb', line 16

def path
  @path
end

Instance Method Details

#generateObject



24
25
26
# File 'lib/seek/sample_templates/generator.rb', line 24

def generate
  run_with_cocaine
end