Class: RubyUI::MaskedInput
- Defined in:
- lib/ruby_ui/masked_input/masked_input.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(save_unmasked: false, **attrs) ⇒ MaskedInput
constructor
A new instance of MaskedInput.
- #view_template ⇒ Object
Constructor Details
#initialize(save_unmasked: false, **attrs) ⇒ MaskedInput
Returns a new instance of MaskedInput.
5 6 7 8 |
# File 'lib/ruby_ui/masked_input/masked_input.rb', line 5 def initialize(save_unmasked: false, **attrs) @save_unmasked = save_unmasked super(**attrs) end |
Instance Method Details
#view_template ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/ruby_ui/masked_input/masked_input.rb', line 10 def view_template if @save_unmasked Input(type: "text", **attrs.merge(name: "#{attrs[:name]}-masked")) input(type: "hidden", name: attrs[:name], value: attrs[:value]) else Input(type: "text", **attrs) end end |