Sha256: b091e6076be93053cd66ceeeaa637623a20de9fd8677e3badce7a774f35a2578

Contents?: true

Size: 429 Bytes

Versions: 5

Compression:

Stored size: 429 Bytes

Contents

class CGen::Generator::List < CGen::Generator::BasicGenerator

  def initialize(param, data, lang)
    super(param, data, lang)
  end

  def generate
    value = get_value(param)
    unless value.is_a?(Array)
      value = Array[value]
    end
    '\begin{itemize}' +
    value.collect do |item|
      get_list(item)
    end.join('') +
    '\end{itemize}'
  end

  protected

  def get_list(item)
    "\\item #{item}"
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
curriculum-generator-1.0.4 lib/cgen/generator/list.rb
curriculum-generator-1.0.3 lib/cgen/generator/list.rb
curriculum-generator-1.0.2 lib/cgen/generator/list.rb
curriculum-generator-1.0.1 lib/cgen/generator/list.rb
curriculum-generator-1.0.0 lib/cgen/generator/list.rb