Class: Plutonium::Wizard::Resume::ResumeUrl

Inherits:
Object
  • Object
show all
Defined in:
lib/plutonium/wizard/resume.rb

Overview

Resolves a single row to its resume URL in the current portal.

Instance Method Summary collapse

Constructor Details

#initialize(row, wizard_class, view_context) ⇒ ResumeUrl

Returns a new instance of ResumeUrl.



116
117
118
119
120
# File 'lib/plutonium/wizard/resume.rb', line 116

def initialize(row, wizard_class, view_context)
  @row = row
  @wizard_class = wizard_class
  @view_context = view_context
end

Instance Method Details

#resolveHash

Returns reason: — exactly one of the two is non-nil.

Returns:

  • (Hash)

    reason: — exactly one of the two is non-nil.



123
124
125
126
127
128
129
130
131
132
133
# File 'lib/plutonium/wizard/resume.rb', line 123

def resolve
  if (named = register_wizard_url)
    return {url: named, reason: nil}
  end

  if (member = resource_member_url)
    return {url: member, reason: nil}
  end

  {url: nil, reason: unresolved_reason}
end