Module: Tramway::Admin::RussianCasesHelper

Included in:
ApplicationHelper
Defined in:
app/helpers/tramway/admin/russian_cases_helper.rb

Instance Method Summary collapse

Instance Method Details

#case_word(model_name, case_name) ⇒ Object



4
5
6
7
8
# File 'app/helpers/tramway/admin/russian_cases_helper.rb', line 4

def case_word(model_name, case_name)
  word_case = I18n.t("cases.#{model_name.name.underscore}.#{case_name}")
  return word_case if word_case.present?
  raise "There is not #{case_name} implementation for \"#{model_name}\""
end

#dative(word) ⇒ Object



18
19
20
# File 'app/helpers/tramway/admin/russian_cases_helper.rb', line 18

def dative(word)
  case_word word, :dative
end

#genitive(word) ⇒ Object



10
11
12
# File 'app/helpers/tramway/admin/russian_cases_helper.rb', line 10

def genitive(word)
  case_word word, :genitive
end

#instrumental(word) ⇒ Object



14
15
16
# File 'app/helpers/tramway/admin/russian_cases_helper.rb', line 14

def instrumental(word)
  case_word word, :instrumental
end

#plural(word) ⇒ Object



22
23
24
# File 'app/helpers/tramway/admin/russian_cases_helper.rb', line 22

def plural(word)
  case_word word, :plural
end