Class: Wizardry::Questions::Hidden

Inherits:
Answer
  • Object
show all
Defined in:
lib/wizardry/questions/hidden.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Answer

#extra_args

Constructor Details

#initialize(name, value) ⇒ Hidden

Returns a new instance of Hidden.



6
7
8
9
10
11
# File 'lib/wizardry/questions/hidden.rb', line 6

def initialize(name, value)
  Rails.logger.debug("🧙 Adding hidden field '#{name}'")
  @value = value

  super(name)
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/wizardry/questions/hidden.rb', line 4

def name
  @name
end

Instance Method Details

#extra_kwargsObject



17
18
19
# File 'lib/wizardry/questions/hidden.rb', line 17

def extra_kwargs
  { value: @value }
end

#form_methodObject



13
14
15
# File 'lib/wizardry/questions/hidden.rb', line 13

def form_method
  :hidden_field
end