Class: SelfField

Inherits:
Field show all
Defined in:
lib/yodel/models/core/fields/self_field.rb

Constant Summary

Constants inherited from Field

Field::TYPES

Instance Attribute Summary

Attributes inherited from Field

#name, #options

Instance Method Summary collapse

Methods inherited from Field

#display?, field_from_type, from_options, #include_in_search_keywords?, #index?, #inherited?, #initialize, #method_missing, #numeric?, #required?, #searchable?, #to_json, #to_str, #unique?

Constructor Details

This class inherits a constructor from Field

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Field

Instance Method Details

#default_input_typeObject



6
7
8
# File 'lib/yodel/models/core/fields/self_field.rb', line 6

def default_input_type
  nil
end

#from_json(value, record) ⇒ Object



22
23
24
# File 'lib/yodel/models/core/fields/self_field.rb', line 22

def from_json(value, record)
  nil
end

#strip_nil?Boolean

Returns:

  • (Boolean)


2
3
4
# File 'lib/yodel/models/core/fields/self_field.rb', line 2

def strip_nil?
  true
end

#typecast(value, record) ⇒ Object



14
15
16
# File 'lib/yodel/models/core/fields/self_field.rb', line 14

def typecast(value, record)
  record
end

#untypecast(value, record) ⇒ Object



18
19
20
# File 'lib/yodel/models/core/fields/self_field.rb', line 18

def untypecast(value, record)
  nil
end

#validate(record, errors) ⇒ Object



10
11
12
# File 'lib/yodel/models/core/fields/self_field.rb', line 10

def validate(record, errors)
  # noop
end