Sha256: 52a1a56b93c43799144b14f44075f86e997f1a18cea6130086552f6a46f87eb2

Contents?: true

Size: 337 Bytes

Versions: 4

Compression:

Stored size: 337 Bytes

Contents

module StyleGuide
  class Partial
    attr_reader :path

    def initialize(path)
      @path = path
    end

    def id
      @id ||= title.downcase.gsub(/[^a-zA-Z0-9]+/, "_")
    end

    def title
      @title ||= File.basename(path, ".erb").titleize.strip
    end

    def content
      @content || File.read(path)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
style-guide-0.3.0 lib/style_guide/partial.rb
style-guide-0.2.1 lib/style_guide/partial.rb
style-guide-0.2.0 lib/style_guide/partial.rb
style-guide-0.1.0 lib/style_guide/partial.rb