Class: Hyrax::FormFields Private

Inherits:
Module
  • Object
show all
Defined in:
lib/hyrax/form_fields.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

See Also:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(schema_name, definition_loader: SimpleSchemaLoader.new) ⇒ FormFields

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Note:

use Hyrax::FormFields(:my_schema) instead

Returns a new instance of FormFields.

Parameters:

  • schema_name (Symbol)
  • definition_loader (#form_definitions_for) (defaults to: SimpleSchemaLoader.new)

28
29
30
31
# File 'lib/hyrax/form_fields.rb', line 28

def initialize(schema_name, definition_loader: SimpleSchemaLoader.new)
  @name = schema_name
  @definition_loader = definition_loader
end

Instance Attribute Details

#nameObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


19
20
21
# File 'lib/hyrax/form_fields.rb', line 19

def name
  @name
end

Instance Method Details

#form_field_definitionsHash{Symbol => Hash{Symbol => Object}}

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Hash{Symbol => Hash{Symbol => Object}})

35
36
37
# File 'lib/hyrax/form_fields.rb', line 35

def form_field_definitions
  @definition_loader.form_definitions_for(schema: name)
end

#inspectString

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (String)

41
42
43
# File 'lib/hyrax/form_fields.rb', line 41

def inspect
  "#{self.class}(#{@name})"
end