Class: Voom::Presenters::DSL::Components::FileInput

Inherits:
Input show all
Includes:
Mixins::Append, Mixins::Buttons, Mixins::Grids
Defined in:
lib/voom/presenters/dsl/components/file_input.rb

Instance Attribute Summary collapse

Attributes inherited from Input

#dirtyable, #disabled, #name

Attributes inherited from EventBase

#event_parent_id

Attributes included from Mixins::Event

#events

Attributes inherited from Base

#attributes, #css_class, #draggable, #drop_zone, #id, #tag, #type

Instance Method Summary collapse

Methods included from Mixins::Grids

#grid

Methods included from Mixins::Buttons

#button

Methods included from Mixins::Append

#<<, #yield_to

Methods inherited from Input

#validation_error

Methods included from Mixins::Tooltips

#tooltip

Methods included from Mixins::Event

#event

Methods inherited from Base

#expand!

Methods included from Pluggable

#include_plugins, #plugin, #plugin_module

Methods included from Mixins::YieldTo

#yield_to

Methods included from Serializer

#to_hash

Methods included from Lockable

#locked?

Constructor Details

#initialize(**attribs_, &block) ⇒ FileInput

Returns a new instance of FileInput.



12
13
14
15
16
17
18
19
20
# File 'lib/voom/presenters/dsl/components/file_input.rb', line 12

def initialize(**attribs_, &block)
  super(type: :file_input, **attribs_, &block)

  @accept =  attribs.delete(:accept) { nil }
  @preview = attribs.delete(:preview) { nil }
  @components = []
  expand!
  default_button
end

Instance Attribute Details

#acceptObject (readonly)

Returns the value of attribute accept.



10
11
12
# File 'lib/voom/presenters/dsl/components/file_input.rb', line 10

def accept
  @accept
end

#componentsObject (readonly)

Returns the value of attribute components.



10
11
12
# File 'lib/voom/presenters/dsl/components/file_input.rb', line 10

def components
  @components
end

#previewObject (readonly)

Returns the value of attribute preview.



10
11
12
# File 'lib/voom/presenters/dsl/components/file_input.rb', line 10

def preview
  @preview
end

Instance Method Details

#value(value = nil) ⇒ Object



22
23
24
25
# File 'lib/voom/presenters/dsl/components/file_input.rb', line 22

def value(value=nil)
  return @value if locked?
  @value = value
end