class Wizardry::Pages::Page

Attributes

pages[R]

Public Class Methods

new(pages: [], before_edit: nil, before_update: nil, after_update: nil) click to toggle source
# File lib/wizardry/pages/page.rb, line 6
def initialize(pages: [], before_edit: nil, before_update: nil, after_update: nil)
  @pages  = pages
  @branch = false

  # callbacks
  @before_edit   = before_edit
  @before_update = before_update
  @after_update  = after_update
end

Public Instance Methods

after_update!(object) click to toggle source
# File lib/wizardry/pages/page.rb, line 44
def after_update!(object)
  return unless @after_update

  @after_update.call(object)
end
before_edit!(object) click to toggle source
# File lib/wizardry/pages/page.rb, line 32
def before_edit!(object)
  return unless @before_edit

  @before_edit.call(object)
end
before_update!(object) click to toggle source
# File lib/wizardry/pages/page.rb, line 38
def before_update!(object)
  return unless @before_update

  @before_update.call(object)
end
branch!() click to toggle source
# File lib/wizardry/pages/page.rb, line 16
def branch!
  @branch = true
end
branch?() click to toggle source
# File lib/wizardry/pages/page.rb, line 20
def branch?
  @branch
end
next_pages() click to toggle source
# File lib/wizardry/pages/page.rb, line 28
def next_pages
  []
end
questions() click to toggle source
# File lib/wizardry/pages/page.rb, line 24
def questions
  []
end