1
0
Fork 0
discourse-custom-wizard-unl.../lib/template.rb
Angus McLeod be81aa7f4d various
2017-11-01 12:21:14 +08:00

27 Zeilen
800 B
Ruby

class CustomWizard::Template
attr_reader :id,
:name,
:steps,
:background,
:save_submissions,
:multiple_submissions,
:after_signup,
:after_time,
:after_time_scheduled,
:required
def initialize(data)
data = data.is_a?(String) ? ::JSON.parse(data) : data
@id = data['id']
@name = data['name']
@steps = data['steps']
@background = data['background']
@save_submissions = data['save_submissions'] || false
@multiple_submissions = data['multiple_submissions'] || false
@after_signup = data['after_signup']
@after_time = data['after_time']
@after_time_scheduled = data['after_time_scheduled']
@required = data['required']
end
end