Class: Sandals::FileField

Inherits:
Object
  • Object
show all
Includes:
Actionable, FieldValidation
Defined in:
lib/sandals/view.rb

Instance Attribute Summary collapse

Attributes included from FieldValidation

#error

Instance Method Summary collapse

Methods included from FieldValidation

#error_id, #invalid?

Constructor Details

#initialize(id, label, action:, error: nil) ⇒ FileField

Returns a new instance of FileField.



486
487
488
489
490
491
# File 'lib/sandals/view.rb', line 486

def initialize(id, label, action:, error: nil)
  @id = id
  @label = label.to_s
  initialize_error(error)
  @action = action
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



484
485
486
# File 'lib/sandals/view.rb', line 484

def id
  @id
end

#labelObject (readonly)

Returns the value of attribute label.



484
485
486
# File 'lib/sandals/view.rb', line 484

def label
  @label
end

Instance Method Details

#change(file) ⇒ Object



493
494
495
# File 'lib/sandals/view.rb', line 493

def change(file)
  execute_action(file)
end