Class: Shimmer::Form::Field

Inherits:
Object
  • Object
show all
Defined in:
lib/shimmer/form/field.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(builder:, method:, collection:, id_method:, name_method:, options: {}) ⇒ Field

Returns a new instance of Field.



23
24
25
26
27
28
29
30
# File 'lib/shimmer/form/field.rb', line 23

def initialize(builder:, method:, collection:, id_method:, name_method:, options: {})
  @builder = builder
  @method = method
  @collection = collection
  @id_method = id_method
  @name_method = name_method
  @options = options
end

Instance Attribute Details

#builderObject (readonly)

Returns the value of attribute builder.



8
9
10
# File 'lib/shimmer/form/field.rb', line 8

def builder
  @builder
end

#collectionObject (readonly)

Returns the value of attribute collection.



8
9
10
# File 'lib/shimmer/form/field.rb', line 8

def collection
  @collection
end

#id_methodObject (readonly)

Returns the value of attribute id_method.



8
9
10
# File 'lib/shimmer/form/field.rb', line 8

def id_method
  @id_method
end

#methodObject (readonly)

Returns the value of attribute method.



8
9
10
# File 'lib/shimmer/form/field.rb', line 8

def method
  @method
end

#name_methodObject (readonly)

Returns the value of attribute name_method.



8
9
10
# File 'lib/shimmer/form/field.rb', line 8

def name_method
  @name_method
end

#optionsObject (readonly)

Returns the value of attribute options.



8
9
10
# File 'lib/shimmer/form/field.rb', line 8

def options
  @options
end

Class Method Details

.can_handle?(method) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/shimmer/form/field.rb', line 11

def can_handle?(method)
  false
end

Instance Method Details

#prepareObject



20
21
# File 'lib/shimmer/form/field.rb', line 20

def prepare
end

#wrapper_optionsObject



16
17
18
# File 'lib/shimmer/form/field.rb', line 16

def wrapper_options
  {}
end