mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-30 10:58:31 -05:00
26 lines
418 B
Ruby
26 lines
418 B
Ruby
class Wizard
|
|
class Step
|
|
attr_reader :id, :updater
|
|
attr_accessor :index, :fields, :next, :previous
|
|
|
|
def initialize(id)
|
|
@id = id
|
|
@fields = []
|
|
end
|
|
|
|
def add_field(attrs)
|
|
field = Field.new(attrs)
|
|
field.step = self
|
|
@fields << field
|
|
field
|
|
end
|
|
|
|
def has_fields?
|
|
@fields.present?
|
|
end
|
|
|
|
def on_update(&block)
|
|
@updater = block
|
|
end
|
|
end
|
|
end
|