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



6
7
8
9
10
11
# File 'app/helpers/tramway/admin/russian_cases_helper.rb', line 6

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



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

def dative(word)
  case_word word, :dative
end

#genitive(word) ⇒ Object



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

def genitive(word)
  case_word word, :genitive
end

#instrumental(word) ⇒ Object



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

def instrumental(word)
  case_word word, :instrumental
end

#russian_plural(word) ⇒ Object



25
26
27
# File 'app/helpers/tramway/admin/russian_cases_helper.rb', line 25

def russian_plural(word)
  case_word word, :plural
end