Class: Panda::Core::Importable::FieldDefinition

Inherits:
Object
  • Object
show all
Defined in:
app/models/concerns/panda/core/importable.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, label:, required: false, transform: nil) ⇒ FieldDefinition

Returns a new instance of FieldDefinition.



11
12
13
14
15
16
# File 'app/models/concerns/panda/core/importable.rb', line 11

def initialize(name, label:, required: false, transform: nil)
  @name = name
  @label = label
  @required = required
  @transform = transform || ->(v) { v }
end

Instance Attribute Details

#labelObject (readonly)

Returns the value of attribute label.



9
10
11
# File 'app/models/concerns/panda/core/importable.rb', line 9

def label
  @label
end

#nameObject (readonly)

Returns the value of attribute name.



9
10
11
# File 'app/models/concerns/panda/core/importable.rb', line 9

def name
  @name
end

#requiredObject (readonly)

Returns the value of attribute required.



9
10
11
# File 'app/models/concerns/panda/core/importable.rb', line 9

def required
  @required
end

#transformObject (readonly)

Returns the value of attribute transform.



9
10
11
# File 'app/models/concerns/panda/core/importable.rb', line 9

def transform
  @transform
end