Class: CommandProposal::Service::ProposalPresenter

Inherits:
Object
  • Object
show all
Includes:
ApplicationHelper
Defined in:
app/models/command_proposal/service/proposal_presenter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ApplicationHelper

#cmd_path, #cmd_url, #engine, #runner_path, #runner_url, #string_path

Constructor Details

#initialize(iteration) ⇒ ProposalPresenter

Returns a new instance of ProposalPresenter.



8
9
10
# File 'app/models/command_proposal/service/proposal_presenter.rb', line 8

def initialize(iteration)
  @iteration = iteration
end

Instance Attribute Details

#iterationObject

Returns the value of attribute iteration.



6
7
8
# File 'app/models/command_proposal/service/proposal_presenter.rb', line 6

def iteration
  @iteration
end

Instance Method Details

#approverObject



33
34
35
# File 'app/models/command_proposal/service/proposal_presenter.rb', line 33

def approver
  @iteration.approver_name
end

#requesterObject



29
30
31
# File 'app/models/command_proposal/service/proposal_presenter.rb', line 29

def requester
  @iteration.requester_name
end

#typeObject



37
38
39
# File 'app/models/command_proposal/service/proposal_presenter.rb', line 37

def type
  @iteration.session_type
end

#urlObject



24
25
26
27
# File 'app/models/command_proposal/service/proposal_presenter.rb', line 24

def url
  path = ::CommandProposal::Engine.routes.url_helpers.command_proposal_task_path(@iteration.task)
  "#{base_path}#{path}"
end