Class: Spina::Forms::LabelComponent

Inherits:
ApplicationComponent show all
Defined in:
app/components/spina/forms/label_component.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(f, method) ⇒ LabelComponent

Returns a new instance of LabelComponent.



6
7
8
9
# File 'app/components/spina/forms/label_component.rb', line 6

def initialize(f, method)
  @f = f
  @method = method
end

Instance Attribute Details

#fObject (readonly)

Returns the value of attribute f.



4
5
6
# File 'app/components/spina/forms/label_component.rb', line 4

def f
  @f
end

#methodObject (readonly)

Returns the value of attribute method.



4
5
6
# File 'app/components/spina/forms/label_component.rb', line 4

def method
  @method
end

Instance Method Details

#callObject



11
12
13
# File 'app/components/spina/forms/label_component.rb', line 11

def call
  f.label method, class: "font-medium text-sm text-gray-700 block"
end