Class: MDWA::DSL::ProcessDetail
- Inherits:
-
Object
- Object
- MDWA::DSL::ProcessDetail
- Defined in:
- lib/mdwa/dsl/process_detail.rb
Instance Attribute Summary collapse
-
#alias ⇒ Object
Unique alias for detailing Default: Detail name underscored.
-
#description ⇒ Object
Returns the value of attribute description.
-
#detail_action ⇒ Object
Returns the value of attribute detail_action.
-
#next_actions ⇒ Object
Returns the value of attribute next_actions.
-
#process ⇒ Object
Returns the value of attribute process.
-
#user_roles ⇒ Object
Returns the value of attribute user_roles.
Instance Method Summary collapse
-
#action(entity, action) ⇒ Object
Refered action Params: => :entity => :action.
-
#initialize(process, description) ⇒ ProcessDetail
constructor
A new instance of ProcessDetail.
-
#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.
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
#alias ⇒ Object
Unique alias for detailing Default: Detail name underscored
22 23 24 |
# File 'lib/mdwa/dsl/process_detail.rb', line 22 def alias @alias end |
#description ⇒ Object
Returns the value of attribute description.
9 10 11 |
# File 'lib/mdwa/dsl/process_detail.rb', line 9 def description @description end |
#detail_action ⇒ Object
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_actions ⇒ Object
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 |
#process ⇒ Object
Returns the value of attribute process.
9 10 11 |
# File 'lib/mdwa/dsl/process_detail.rb', line 9 def process @process end |
#user_roles ⇒ Object
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, = {}) next_action = ProcessDetailNextAction.new(detail_alias) next_action.method = [:method] || :get next_action.request = [:request] || :html next_action.redirect = [:redirect] || false next_action.render = [:render] || false next_action.when = [:when] next_actions << next_action end |