Class: LanguageCards::Controllers::ApplicationController

Inherits:
Object
  • Object
show all
Includes:
Helpers::ViewHelper
Defined in:
lib/language_cards/controllers/application_controller.rb

Direct Known Subclasses

Game, MainMenu

Instance Method Summary collapse

Methods included from Helpers::ViewHelper

#clear, #divider, #draw, #humanize, #snake, #t, #wordwrap

Constructor Details

#initialize(opts = {}) ⇒ ApplicationController

Returns a new instance of ApplicationController.



6
7
8
# File 'lib/language_cards/controllers/application_controller.rb', line 6

def initialize(opts = {})
  @opts = opts
end

Instance Method Details

#render(_binding) ⇒ Object



10
11
12
13
14
# File 'lib/language_cards/controllers/application_controller.rb', line 10

def render(_binding)
  view = ERB.new IO.read File.expand_path("../view/#{snake name}.erb", __dir__)

  view.result(_binding)
end