mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
22 lines
370 B
Ruby
22 lines
370 B
Ruby
class Wizard
|
|
class Field
|
|
|
|
attr_reader :id, :type, :required, :value, :options
|
|
attr_accessor :step
|
|
|
|
def initialize(attrs)
|
|
attrs = attrs || {}
|
|
|
|
@id = attrs[:id]
|
|
@type = attrs[:type]
|
|
@required = !!attrs[:required]
|
|
@value = attrs[:value]
|
|
@options = []
|
|
end
|
|
|
|
def add_option(id)
|
|
@options << id
|
|
end
|
|
|
|
end
|
|
end
|