Class: Coco::ImageUploader

Inherits:
Component
  • Object
show all
Includes:
Concerns::AcceptsOptions
Defined in:
app/components/coco/base/image_uploader/image_uploader.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Concerns::AcceptsOptions

#accepted_options, #get_option_group

Constructor Details

#initialize(accept: "image/*", **kwargs) ⇒ ImageUploader

Returns a new instance of ImageUploader.



10
11
12
# File 'app/components/coco/base/image_uploader/image_uploader.rb', line 10

def initialize(accept: "image/*", **kwargs)
  @accept = accept
end

Instance Attribute Details

#accept ⇒ Object (readonly)

Returns the value of attribute accept.



8
9
10
# File 'app/components/coco/base/image_uploader/image_uploader.rb', line 8

def accept
  @accept
end

#name ⇒ Object (readonly)

Returns the value of attribute name.



8
9
10
# File 'app/components/coco/base/image_uploader/image_uploader.rb', line 8

def name
  @name
end

Instance Method Details

#clickable? ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
# File 'app/components/coco/base/image_uploader/image_uploader.rb', line 14

def clickable?
  get_option_value(:click)
end

#droppable? ⇒ Boolean

Returns:

  • (Boolean)


18
19
20
# File 'app/components/coco/base/image_uploader/image_uploader.rb', line 18

def droppable?
  get_option_value(:drop)
end