Sha256: 7ed728d60d412dbd09b2ef117caa054cca79054b14bcb406e88e95706f4278a3
Contents?: true
Size: 908 Bytes
Versions: 3
Compression:
Stored size: 908 Bytes
Contents
module CurriculumGenerator module Generator class CvColumn < 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{cvcolumns}" + (value.collect do |elem| instance = self result = Either.chain do bind -> { elem.is_a?(Hash) } bind -> { elem.has_key?('item_0') && elem.has_key?('item_1') } bind -> { instance.get_cv_list_double_item(elem['item_0'], elem['item_1']) } end result.success? ? result.fetch : '' end.join("\n")) + "\\end{cvcolumns") end protected def get_cv_list_double_item(item_0, item_1) "\\cvcolumn{#{item_0}}{#{item_1}}" end end end end
Version data entries
3 entries across 3 versions & 1 rubygems