Class: Decidim::Forms::AnswerOptionPresenter

Inherits:
SimpleDelegator
  • Object
show all
Includes:
TranslationsHelper
Defined in:
decidim-forms/app/presenters/decidim/forms/answer_option_presenter.rb

Overview

Decorator for answer_options

Instance Method Summary collapse

Methods included from TranslationsHelper

empty_translatable, ensure_translatable, multi_translation, translated_in_current_locale?

Methods included from TranslatableAttributes

#default_locale?

Instance Method Details

#as_json(*_args) ⇒ Object



15
16
17
# File 'decidim-forms/app/presenters/decidim/forms/answer_option_presenter.rb', line 15

def as_json(*_args)
  { id:, body: translated_body }
end

#translated_bodyObject



11
12
13
# File 'decidim-forms/app/presenters/decidim/forms/answer_option_presenter.rb', line 11

def translated_body
  @translated_body ||= translated_attribute body
end