Sha256: f226d5b1d46b4e44ca6bc26e365021c322956c697f92b181585cb3612997bada

Contents?: true

Size: 878 Bytes

Versions: 27

Compression:

Stored size: 878 Bytes

Contents

# frozen_string_literal: true

require 'active_model'

module Quby
  module Questionnaires
    module Entities
      class Item
        include ActiveModel::Validations
        include ActiveSupport::Callbacks
        define_callbacks :after_dsl_enhance

        attr_accessor :presentation
        attr_accessor :switch_cycle

        # Raw content may contain a raw HTML replacement for this item
        attr_accessor :raw_content

        def initialize(options = {})
          @raw_content = options[:raw_content]
          @switch_cycle = options[:switch_cycle] || false
        end

        def presentation
          @presentation || "vertical"
        end

        def as_json(options = {})
          {
            class: self.class.to_s
          }
        end

        def to_codebook(questionnaire, options = {})
          ""
        end
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
quby-5.4.0 lib/quby/questionnaires/entities/item.rb
quby-5.3.1 lib/quby/questionnaires/entities/item.rb
quby-5.3.0 lib/quby/questionnaires/entities/item.rb
quby-5.2.0 lib/quby/questionnaires/entities/item.rb
quby-5.1.3 lib/quby/questionnaires/entities/item.rb
quby-5.1.2 lib/quby/questionnaires/entities/item.rb
quby-5.1.1 lib/quby/questionnaires/entities/item.rb
quby-5.1.0 lib/quby/questionnaires/entities/item.rb
quby-5.0.5 lib/quby/questionnaires/entities/item.rb
quby-5.0.4 lib/quby/questionnaires/entities/item.rb
quby-5.0.3 lib/quby/questionnaires/entities/item.rb
quby-5.0.2 lib/quby/questionnaires/entities/item.rb
quby-5.0.1 lib/quby/questionnaires/entities/item.rb
quby-5.0.0 lib/quby/questionnaires/entities/item.rb
quby-4.0.4 lib/quby/questionnaires/entities/item.rb
quby-5.0.0.pre4 lib/quby/questionnaires/entities/item.rb
quby-5.0.0.pre3 lib/quby/questionnaires/entities/item.rb
quby-5.0.0.pre2 lib/quby/questionnaires/entities/item.rb
quby-5.0.0.pre1 lib/quby/questionnaires/entities/item.rb
quby-4.0.3 lib/quby/questionnaires/entities/item.rb