Sha256: 57201c632b3faacde11bc46af481985845616b9f5b73f667d2199a5a4dc19cda

Contents?: true

Size: 872 Bytes

Versions: 15

Compression:

Stored size: 872 Bytes

Contents

# frozen_string_literal: true

require 'active_model'

module Quby
  module Compiler
    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

15 entries across 15 versions & 1 rubygems

Version Path
quby-compiler-0.4.7 lib/quby/compiler/entities/item.rb
quby-compiler-0.4.6 lib/quby/compiler/entities/item.rb
quby-compiler-0.4.5 lib/quby/compiler/entities/item.rb
quby-compiler-0.4.4 lib/quby/compiler/entities/item.rb
quby-compiler-0.4.3 lib/quby/compiler/entities/item.rb
quby-compiler-0.4.2 lib/quby/compiler/entities/item.rb
quby-compiler-0.4.1 lib/quby/compiler/entities/item.rb
quby-compiler-0.4.0 lib/quby/compiler/entities/item.rb
quby-compiler-0.3.7 lib/quby/compiler/entities/item.rb
quby-compiler-0.3.6 lib/quby/compiler/entities/item.rb
quby-compiler-0.3.5 lib/quby/compiler/entities/item.rb
quby-compiler-0.3.4 lib/quby/compiler/entities/item.rb
quby-compiler-0.3.3 lib/quby/compiler/entities/item.rb
quby-compiler-0.3.1 lib/quby/compiler/entities/item.rb
quby-compiler-0.2.1 lib/quby/compiler/entities/item.rb