Class: Plutonium::Wizard::FieldImporter::Spec

Inherits:
Struct
  • Object
show all
Defined in:
lib/plutonium/wizard/field_importer.rb

Overview

The resolved import surface for one using: declaration.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#attribute_schemaObject

Returns the value of attribute attribute_schema

Returns:

  • (Object)

    the current value of attribute_schema



39
40
41
# File 'lib/plutonium/wizard/field_importer.rb', line 39

def attribute_schema
  @attribute_schema
end

#form_layoutObject

Returns the value of attribute form_layout

Returns:

  • (Object)

    the current value of form_layout



39
40
41
# File 'lib/plutonium/wizard/field_importer.rb', line 39

def form_layout
  @form_layout
end

#form_validatorsObject

Returns the value of attribute form_validators

Returns:

  • (Object)

    the current value of form_validators



39
40
41
# File 'lib/plutonium/wizard/field_importer.rb', line 39

def form_validators
  @form_validators
end

#inputsObject

Returns the value of attribute inputs

Returns:

  • (Object)

    the current value of inputs



39
40
41
# File 'lib/plutonium/wizard/field_importer.rb', line 39

def inputs
  @inputs
end

#validate_fnObject

Returns the value of attribute validate_fn

Returns:

  • (Object)

    the current value of validate_fn



39
40
41
# File 'lib/plutonium/wizard/field_importer.rb', line 39

def validate_fn
  @validate_fn
end

Instance Method Details

#validate(data_slice) ⇒ Object

Run the imported validation over a staged data slice, returning a hash of => [messages] for the imported fields + :base. Empty when validate: false.



43
44
45
# File 'lib/plutonium/wizard/field_importer.rb', line 43

def validate(data_slice)
  validate_fn ? validate_fn.call(data_slice) : {}
end