Class: ModelFormFacade::Field

Inherits:
Data
  • Object
show all
Defined in:
lib/model_form_facade.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#attributeObject (readonly)

Returns the value of attribute attribute

Returns:

  • (Object)

    the current value of attribute



99
100
101
# File 'lib/model_form_facade.rb', line 99

def attribute
  @attribute
end

#formObject (readonly)

Returns the value of attribute form

Returns:

  • (Object)

    the current value of form



99
100
101
# File 'lib/model_form_facade.rb', line 99

def form
  @form
end

#nameObject (readonly)

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



99
100
101
# File 'lib/model_form_facade.rb', line 99

def name
  @name
end

#readObject (readonly)

Returns the value of attribute read

Returns:

  • (Object)

    the current value of read



99
100
101
# File 'lib/model_form_facade.rb', line 99

def read
  @read
end

#typeObject (readonly)

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



99
100
101
# File 'lib/model_form_facade.rb', line 99

def type
  @type
end

#writeObject (readonly)

Returns the value of attribute write

Returns:

  • (Object)

    the current value of write



99
100
101
# File 'lib/model_form_facade.rb', line 99

def write
  @write
end

Instance Method Details

#serialize(v) ⇒ Object



100
101
102
103
# File 'lib/model_form_facade.rb', line 100

def serialize(v)
  return v unless type == :scalar
  v&.to_s
end