Class: MDWA::DSL::ProcessDetail

Inherits:
Object
  • Object
show all
Defined in:
lib/mdwa/dsl/process_detail.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(process, description) ⇒ ProcessDetail

Returns a new instance of ProcessDetail.



11
12
13
14
15
16
17
18
# File 'lib/mdwa/dsl/process_detail.rb', line 11

def initialize(process, description)
  self.process      = process
  self.description  = description
  
  self.user_roles   = []
  self.next_actions = []
  self.detail_action = OpenStruct.new
end

Instance Attribute Details

#aliasObject

Unique alias for detailing Default: Detail name underscored



22
23
24
# File 'lib/mdwa/dsl/process_detail.rb', line 22

def alias
  @alias
end

#descriptionObject

Returns the value of attribute description.



9
10
11
# File 'lib/mdwa/dsl/process_detail.rb', line 9

def description
  @description
end

#detail_actionObject

Returns the value of attribute detail_action.



9
10
11
# File 'lib/mdwa/dsl/process_detail.rb', line 9

def detail_action
  @detail_action
end

#next_actionsObject

Returns the value of attribute next_actions.



9
10
11
# File 'lib/mdwa/dsl/process_detail.rb', line 9

def next_actions
  @next_actions
end

#processObject

Returns the value of attribute process.



9
10
11
# File 'lib/mdwa/dsl/process_detail.rb', line 9

def process
  @process
end

#user_rolesObject

Returns the value of attribute user_roles.



9
10
11
# File 'lib/mdwa/dsl/process_detail.rb', line 9

def user_roles
  @user_roles
end

Instance Method Details

#action(entity, action) ⇒ Object

Refered action Params:

> :entity

> :action



30
31
32
33
# File 'lib/mdwa/dsl/process_detail.rb', line 30

def action(entity, action)
  self.detail_action.entity = entity
  self.detail_action.action = action
end

#next_action(detail_alias, options = {}) ⇒ Object

Possible next action Params:

> :alias

> :entity

> :action

> :method

> :request

> :redirect => boolean

> :render => boolean

> :when - situation when it might occur



45
46
47
48
49
50
51
52
53
54
# File 'lib/mdwa/dsl/process_detail.rb', line 45

def next_action(detail_alias, options = {})
  next_action = ProcessDetailNextAction.new(detail_alias)
  next_action.method    = options[:method] || :get
  next_action.request   = options[:request] || :html
  next_action.redirect  = options[:redirect] || false
  next_action.render    = options[:render] || false
  next_action.when      = options[:when]

  next_actions << next_action
end