Sha256: e30c958787079b6c61763b4df7a324a18abd8dbad77830f00b320c7aedf71dc0

Contents?: true

Size: 569 Bytes

Versions: 4

Compression:

Stored size: 569 Bytes

Contents

module TermNote
  module Pane
    class Chapter
      include Pane
      include Helpers::Title

      attr_accessor :title, :subtitle

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

      def rows
        subtitle ? title_row + subtitle_row : title_row
      end

      private

      def subtitle_row
        wrapped_title(subtitle).map &method(:subtitle_row_format)
      end

      def subtitle_row_format(row)
        row.join
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
termnote-2.0.1 lib/termnote/pane/chapter.rb
termnote-2.0.0 lib/termnote/pane/chapter.rb
termnote-1.5.1 lib/termnote/pane/chapter.rb
termnote-1.5.0 lib/termnote/pane/chapter.rb