Sha256: 565a9fadb19a78a5ab8b9f9734abbeb61430b5c272223baea7c36580ac96ec6e

Contents?: true

Size: 531 Bytes

Versions: 2

Compression:

Stored size: 531 Bytes

Contents

module CurriculumGenerator
  module Generator
    class List < 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
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
curriculum-generator-1.0.7 lib/curriculum-generator/generator/list.rb
curriculum-generator-1.0.6 lib/curriculum-generator/generator/list.rb