Class: Para::AttributeField::PasswordField

Inherits:
Base
  • Object
show all
Defined in:
lib/para/attribute_field/password.rb

Instance Attribute Summary

Attributes inherited from Base

#field_method, #field_type, #model, #name, #options, #type

Instance Method Summary collapse

Methods inherited from Base

#attribute_column_path, #determine_name_and_field_method!, #excerptable_value?, #field_name, field_option, #field_options, field_types, register, #searchable?, #type?

Constructor Details

#initialize(model, options = {}) ⇒ PasswordField

Returns a new instance of PasswordField.



6
7
8
9
# File 'lib/para/attribute_field/password.rb', line 6

def initialize(model, options = {})
  options.reverse_merge!(type: 'password', field_type: 'password')
  super(model, options)
end

Instance Method Details

#parse_input(params, resource) ⇒ Object



15
16
17
# File 'lib/para/attribute_field/password.rb', line 15

def parse_input(params, resource)
  params[name] = params[name].presence if resource.respond_to?(:"#{name}=")
end

#value_for(instance) ⇒ Object



11
12
13
# File 'lib/para/attribute_field/password.rb', line 11

def value_for(instance)
  nil
end