2021-03-11 07:30:15 +01:00
|
|
|
# frozen_string_literal: true
|
2019-12-05 09:05:21 +01:00
|
|
|
module CustomWizardFieldExtension
|
2020-11-26 04:05:50 +01:00
|
|
|
attr_reader :raw,
|
|
|
|
:label,
|
2019-12-05 09:05:21 +01:00
|
|
|
:description,
|
|
|
|
:image,
|
|
|
|
:key,
|
2021-01-30 18:46:04 +01:00
|
|
|
:validations,
|
2019-12-05 09:05:21 +01:00
|
|
|
:min_length,
|
2020-12-08 08:14:37 +01:00
|
|
|
:max_length,
|
2021-01-12 11:46:24 +01:00
|
|
|
:char_counter,
|
2019-12-05 09:05:21 +01:00
|
|
|
:file_types,
|
2020-07-16 05:26:56 +02:00
|
|
|
:format,
|
2019-12-05 09:05:21 +01:00
|
|
|
:limit,
|
2020-03-24 10:35:46 +01:00
|
|
|
:property,
|
2021-01-19 08:50:37 +01:00
|
|
|
:content,
|
|
|
|
:number
|
2021-03-11 07:30:15 +01:00
|
|
|
|
2019-12-05 09:05:21 +01:00
|
|
|
def initialize(attrs)
|
2020-04-29 04:28:57 +02:00
|
|
|
super
|
2020-11-26 04:05:50 +01:00
|
|
|
@raw = attrs || {}
|
2019-12-05 09:05:21 +01:00
|
|
|
@description = attrs[:description]
|
|
|
|
@image = attrs[:image]
|
|
|
|
@key = attrs[:key]
|
2021-01-30 18:46:04 +01:00
|
|
|
@validations = attrs[:validations]
|
2019-12-05 09:05:21 +01:00
|
|
|
@min_length = attrs[:min_length]
|
2020-12-08 08:14:37 +01:00
|
|
|
@max_length = attrs[:max_length]
|
2021-01-12 11:46:24 +01:00
|
|
|
@char_counter = attrs[:char_counter]
|
2019-12-05 09:05:21 +01:00
|
|
|
@file_types = attrs[:file_types]
|
2020-07-16 05:26:56 +02:00
|
|
|
@format = attrs[:format]
|
2019-12-05 09:05:21 +01:00
|
|
|
@limit = attrs[:limit]
|
|
|
|
@property = attrs[:property]
|
2020-03-30 08:16:03 +02:00
|
|
|
@content = attrs[:content]
|
2021-01-19 08:50:37 +01:00
|
|
|
@number = attrs[:number]
|
2019-12-05 09:05:21 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def label
|
2020-11-26 04:05:50 +01:00
|
|
|
@label ||= PrettyText.cook(@raw[:label])
|
2019-12-05 09:05:21 +01:00
|
|
|
end
|
2021-03-11 07:30:15 +01:00
|
|
|
end
|