Class: Panda::Core::Importable::FieldDefinition
- Inherits:
-
Object
- Object
- Panda::Core::Importable::FieldDefinition
- Defined in:
- app/models/concerns/panda/core/importable.rb
Instance Attribute Summary collapse
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#required ⇒ Object
readonly
Returns the value of attribute required.
-
#transform ⇒ Object
readonly
Returns the value of attribute transform.
Instance Method Summary collapse
-
#initialize(name, label:, required: false, transform: nil) ⇒ FieldDefinition
constructor
A new instance of FieldDefinition.
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
#label ⇒ Object (readonly)
Returns the value of attribute label.
9 10 11 |
# File 'app/models/concerns/panda/core/importable.rb', line 9 def label @label end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
9 10 11 |
# File 'app/models/concerns/panda/core/importable.rb', line 9 def name @name end |
#required ⇒ Object (readonly)
Returns the value of attribute required.
9 10 11 |
# File 'app/models/concerns/panda/core/importable.rb', line 9 def required @required end |
#transform ⇒ Object (readonly)
Returns the value of attribute transform.
9 10 11 |
# File 'app/models/concerns/panda/core/importable.rb', line 9 def transform @transform end |