Sha256: 36b8969ebd57ee06124d4f876a49e0cd86eb5f6d15cdda0e95ce8d643772608f

Contents?: true

Size: 1002 Bytes

Versions: 78

Compression:

Stored size: 1002 Bytes

Contents

module Avo
  module Fields
    class FileField < BaseField
      attr_accessor :link_to_resource
      attr_accessor :is_avatar
      attr_accessor :is_image
      attr_accessor :is_audio
      attr_accessor :direct_upload
      attr_accessor :accept
      attr_reader :display_filename

      def initialize(id, **args, &block)
        super(id, **args, &block)

        @link_to_resource = args[:link_to_resource].present? ? args[:link_to_resource] : false
        @is_avatar = args[:is_avatar].present? ? args[:is_avatar] : false
        @is_image = args[:is_image].present? ? args[:is_image] : @is_avatar
        @is_audio = args[:is_audio].present? ? args[:is_audio] : false
        @direct_upload = args[:direct_upload].present? ? args[:direct_upload] : false
        @accept = args[:accept].present? ? args[:accept] : nil
        @display_filename = args[:display_filename].nil? ? true : args[:display_filename]
      end

      def path
        rails_blob_url value
      end
    end
  end
end

Version data entries

78 entries across 78 versions & 1 rubygems

Version Path
avo-2.33.2 lib/avo/fields/file_field.rb
avo-2.33.1 lib/avo/fields/file_field.rb
avo-2.33.0 lib/avo/fields/file_field.rb
avo-2.32.6 lib/avo/fields/file_field.rb
avo-2.32.5 lib/avo/fields/file_field.rb
avo-2.32.4 lib/avo/fields/file_field.rb
avo-2.32.3 lib/avo/fields/file_field.rb
avo-2.32.2 lib/avo/fields/file_field.rb
avo-2.32.1 lib/avo/fields/file_field.rb
avo-2.32.0 lib/avo/fields/file_field.rb
avo-2.31.0 lib/avo/fields/file_field.rb
avo-2.30.2 lib/avo/fields/file_field.rb
avo-2.30.1 lib/avo/fields/file_field.rb
avo-2.30.1.pre4.pr1683 lib/avo/fields/file_field.rb
avo-2.30.1.pre3.pr1683 lib/avo/fields/file_field.rb
avo-2.30.1.pre2.pr1683 lib/avo/fields/file_field.rb
avo-2.30.1.pre1.pr1683 lib/avo/fields/file_field.rb
avo-2.30.0 lib/avo/fields/file_field.rb