Sha256: 256781055422651c1b2a29b136d15654a51387796cb24c329bd81b427ffea27d

Contents?: true

Size: 414 Bytes

Versions: 2

Compression:

Stored size: 414 Bytes

Contents

module TermNote
  module Pane
    class List
      include Pane

      attr_accessor :title, :items

      def initialize(options)
        @title = options[:title] || options['title']
        @items = options[:items] || options['items']
      end

      def rows
        items.map { |item| "* #{item}" }.unshift title.bold + "\n"
      end

      def gutter
        " " * (width * 0.5)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
termnote-1.1.0 lib/termnote/pane/list.rb
termnote-1.0.0 lib/termnote/pane/list.rb