Sha256: 56e0682e105fcdc0285a0df7932731d87237aac98139dea62e1d0a56521a0158

Contents?: true

Size: 389 Bytes

Versions: 45

Compression:

Stored size: 389 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Forms
    #
    # Decorator for answer_options
    #
    class AnswerOptionPresenter < SimpleDelegator
      include Decidim::TranslationsHelper

      def translated_body
        @translated_body ||= translated_attribute body
      end

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

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
decidim-forms-0.26.1 app/presenters/decidim/forms/answer_option_presenter.rb
decidim-forms-0.26.0 app/presenters/decidim/forms/answer_option_presenter.rb
decidim-forms-0.26.0.rc2 app/presenters/decidim/forms/answer_option_presenter.rb
decidim-forms-0.26.0.rc1 app/presenters/decidim/forms/answer_option_presenter.rb
decidim-forms-0.25.2 app/presenters/decidim/forms/answer_option_presenter.rb
decidim-forms-0.25.1 app/presenters/decidim/forms/answer_option_presenter.rb
decidim-forms-0.25.0 app/presenters/decidim/forms/answer_option_presenter.rb
decidim-forms-0.25.0.rc4 app/presenters/decidim/forms/answer_option_presenter.rb
decidim-forms-0.25.0.rc3 app/presenters/decidim/forms/answer_option_presenter.rb
decidim-forms-0.25.0.rc2 app/presenters/decidim/forms/answer_option_presenter.rb
decidim-forms-0.25.0.rc1 app/presenters/decidim/forms/answer_option_presenter.rb
decidim-forms-0.24.3 app/presenters/decidim/forms/answer_option_presenter.rb
decidim-forms-0.23.6 app/presenters/decidim/forms/answer_option_presenter.rb
decidim-forms-0.24.2 app/presenters/decidim/forms/answer_option_presenter.rb
decidim-forms-0.23.5 app/presenters/decidim/forms/answer_option_presenter.rb
decidim-forms-0.24.1 app/presenters/decidim/forms/answer_option_presenter.rb
decidim-forms-0.24.0 app/presenters/decidim/forms/answer_option_presenter.rb
decidim-forms-0.24.0.rc2 app/presenters/decidim/forms/answer_option_presenter.rb
decidim-forms-0.23.4 app/presenters/decidim/forms/answer_option_presenter.rb
decidim-forms-0.24.0.rc1 app/presenters/decidim/forms/answer_option_presenter.rb