Sha256: 88699526a1bf275e77d68b176f2e5f111e36fd3a5ebc2521af064eadfb4d1441

Contents?: true

Size: 918 Bytes

Versions: 36

Compression:

Stored size: 918 Bytes

Contents

module Avo
  module Fields
    class CodeField < BaseField
      attr_reader :height
      attr_reader :language
      attr_reader :theme
      attr_reader :tab_size
      attr_reader :indent_with_tabs
      attr_reader :line_wrapping

      def initialize(name, **args, &block)
        @defaults = {
          partial_name: "code-field"
        }

        hide_on :index

        super(name, **args, &block)

        @language = args[:language].present? ? args[:language].to_s : "javascript"
        @theme = args[:theme].present? ? args[:theme].to_s : "material-darker"
        @height = args[:height].present? ? args[:height].to_s : "auto"
        @tab_size = args[:tab_size].present? ? args[:tab_size] : 2
        @indent_with_tabs = args[:indent_with_tabs].present? ? args[:indent_with_tabs] : false
        @line_wrapping = args[:line_wrapping].present? ? args[:line_wrapping] : true
      end
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
avo-1.4.0.pre.1 lib/avo/fields/code_field.rb
avo-1.3.5 lib/avo/fields/code_field.rb
avo-1.3.5.pre.1 lib/avo/fields/code_field.rb
avo-1.3.4 lib/avo/fields/code_field.rb
avo-1.3.3 lib/avo/fields/code_field.rb
avo-1.3.2 lib/avo/fields/code_field.rb
avo-1.3.1 lib/avo/fields/code_field.rb
avo-1.3.0 lib/avo/fields/code_field.rb
avo-1.2.11.pre.4 lib/avo/fields/code_field.rb
avo-1.2.11.pre.3 lib/avo/fields/code_field.rb
avo-1.2.11.pre.2 lib/avo/fields/code_field.rb
avo-1.2.11.pre.1 lib/avo/fields/code_field.rb
avo-1.2.10 lib/avo/fields/code_field.rb
avo-1.2.9 lib/avo/fields/code_field.rb
avo-1.2.8 lib/avo/fields/code_field.rb
avo-1.2.7 lib/avo/fields/code_field.rb
avo-1.2.6 lib/avo/fields/code_field.rb
avo-1.2.6.pre.1 lib/avo/fields/code_field.rb
avo-1.2.5 lib/avo/fields/code_field.rb
avo-1.2.4 lib/avo/fields/code_field.rb