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, version: 1, contexts: nil) ⇒ 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
32
33
# File 'lib/hyrax/form_fields.rb', line 28

def initialize(schema_name, definition_loader: SimpleSchemaLoader.new, version: 1, contexts: nil)
  @contexts = contexts
  @definition_loader = definition_loader
  @name = schema_name
  @version = version
end

Instance Attribute Details

#contextsObject (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 contexts
  @contexts
end

#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

#versionObject (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 version
  @version
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}})


37
38
39
# File 'lib/hyrax/form_fields.rb', line 37

def form_field_definitions
  @definition_loader.form_definitions_for(schema: name, version:, contexts:)
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)


43
44
45
# File 'lib/hyrax/form_fields.rb', line 43

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