Sha256: f3f33f9dfa10eae86690e0c0dd20879346354b55a06a641bbc063e10e2869efe

Contents?: true

Size: 678 Bytes

Versions: 1

Compression:

Stored size: 678 Bytes

Contents

module LanguageCards
  module Controllers
    module MainMenu
      class << self
        include Helpers::ViewHelper

        def render(courses:, mode:)
          _title = t 'Menu.Title'
          _select = t 'Menu.Choose'
          _mode = case mode.peek
                  when :translate then t 'Menu.ModeTranslate'
                  when :typing then t 'Menu.ModeTyping'
                  end
          _courses = courses.each.with_index.map {|item,index| "#{index + 1}: #{item}" }
          _mexit = t 'Menu.Exit'

          view = ERB.new(IO.read(File.expand_path('../view/main_menu.erb', __dir__)))
          view.result(binding)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
language_cards-0.1.3 lib/language_cards/controllers/main_menu.rb