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.53.0 lib/avo/fields/file_field.rb
avo-2.52.0 lib/avo/fields/file_field.rb
avo-2.49.0 lib/avo/fields/file_field.rb
avo-2.48.0 lib/avo/fields/file_field.rb
avo-2.47.0 lib/avo/fields/file_field.rb
avo-3.0.1.beta8 lib/avo/fields/file_field.rb
avo-3.0.1.beta6 lib/avo/fields/file_field.rb
avo-3.0.1.beta7 lib/avo/fields/file_field.rb
avo-3.0.1.beta5 lib/avo/fields/file_field.rb
avo-3.0.1.beta2 lib/avo/fields/file_field.rb
avo-3.0.1.beta4 lib/avo/fields/file_field.rb
avo-3.0.1.beta3 lib/avo/fields/file_field.rb
avo-3.0.0.beta1 lib/avo/fields/file_field.rb
avo-3.0.1.beta1 lib/avo/fields/file_field.rb
avo-3.0.0.pre17 lib/avo/fields/file_field.rb
avo-3.0.0.pre18 lib/avo/fields/file_field.rb
avo-3.0.0.pre14 lib/avo/fields/file_field.rb
avo-3.0.0.pre16 lib/avo/fields/file_field.rb
avo-3.0.0.pre15 lib/avo/fields/file_field.rb
avo-3.0.0.pre13 lib/avo/fields/file_field.rb