Sha256: 1d23ccc03cb76f6b609766ff5da8a8dd020fce8ff17b04c9f6a6db35811da866

Contents?: true

Size: 494 Bytes

Versions: 1

Compression:

Stored size: 494 Bytes

Contents

module LanguageCards
  module Helpers
    module ViewHelper
      def divider
        '~' * SUBMENUWIDTH
      end

      def t str
        I18n.t str
      end

      def draw left=nil, center=nil, right=nil
        width = SUBMENUWIDTH
        str = left.to_s
        str = str + center.to_s.rjust(width/2 - str.length + center.to_s.length/2)
        str + right.to_s.rjust(width - str.length)
      end

      def clear
        printf ::LanguageCards::ESC::CLEAR
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
language_cards-0.1.3 lib/language_cards/helpers/view_helper.rb