Sha256: c5d247fc0f263aeb5e75fe9bdb88e968c435f7c6eab4c179ca5d173174c498d6
Contents?: true
Size: 428 Bytes
Versions: 17
Compression:
Stored size: 428 Bytes
Contents
module LessonsIndexer module Models class Lesson < Base NAME_PATTERN = /(?<minor_major>(?<major>(\d+))(?:\.|-)(?<minor>(\d+)))(?<ext>\.md)/i attr_reader :name def initialize(file_name) super file_name @name = file_name.gsub(NAME_PATTERN, ' \k<minor_major>').titlecase end def link(dir) "* [#{name}](#{dir}/#{file_name})\n" end end end end
Version data entries
17 entries across 17 versions & 1 rubygems