Class: MetadataPresenter::Flow

Inherits:
Metadata
  • Object
show all
Defined in:
app/models/metadata_presenter/flow.rb

Instance Attribute Summary

Attributes inherited from Metadata

#metadata

Instance Method Summary collapse

Methods inherited from Metadata

#==, #editor?, #id, #initialize, #method_missing, #respond_to_missing?, #to_json, #type, #uuid

Constructor Details

This class inherits a constructor from MetadataPresenter::Metadata

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class MetadataPresenter::Metadata

Instance Method Details

#branch?Boolean

Returns:

  • (Boolean)


3
4
5
# File 'app/models/metadata_presenter/flow.rb', line 3

def branch?
  type == 'branch'
end

#conditionsObject



11
12
13
14
15
# File 'app/models/metadata_presenter/flow.rb', line 11

def conditions
  Array(['next']['conditions']).map do ||
    Condition.new()
  end
end

#default_nextObject



7
8
9
# File 'app/models/metadata_presenter/flow.rb', line 7

def default_next
  ['next']['default']
end

#group_by_pageObject



17
18
19
# File 'app/models/metadata_presenter/flow.rb', line 17

def group_by_page
  conditions.group_by(&:next)
end