Class: ActiveInteraction::Input

Inherits:
Object
  • Object
show all
Defined in:
lib/active_interaction/input.rb

Overview

Represents a processed input.

Direct Known Subclasses

ArrayInput, HashInput

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filter, value: nil, error: nil) ⇒ Input

Returns a new instance of Input.



7
8
9
10
11
# File 'lib/active_interaction/input.rb', line 7

def initialize(filter, value: nil, error: nil)
  @filter = filter
  @value = value
  @error = error
end

Instance Attribute Details

#valueObject (readonly)

The processed input value.



14
15
16
# File 'lib/active_interaction/input.rb', line 14

def value
  @value
end

Instance Method Details

#errorsFilter::Error

Any errors that occurred during processing.

Returns:



19
20
21
# File 'lib/active_interaction/input.rb', line 19

def errors
  @errors ||= Array(@error)
end