Class: MetadataPresenter::Flow
Instance Attribute Summary collapse
Attributes inherited from Metadata
#metadata
Instance Method Summary
collapse
Methods inherited from Metadata
#==, #editor?, #id, #method_missing, #respond_to_missing?, #to_json, #type
Constructor Details
#initialize(uuid, flow) ⇒ Flow
Returns a new instance of Flow.
5
6
7
8
9
|
# File 'app/models/metadata_presenter/flow.rb', line 5
def initialize(uuid, flow)
@uuid = uuid
super(flow)
end
|
Instance Attribute Details
#uuid ⇒ Object
Returns the value of attribute uuid.
3
4
5
|
# File 'app/models/metadata_presenter/flow.rb', line 3
def uuid
@uuid
end
|
Instance Method Details
#all_destination_uuids ⇒ Object
19
20
21
|
# File 'app/models/metadata_presenter/flow.rb', line 19
def all_destination_uuids
conditionals.map(&:next).append(default_next)
end
|
#branch? ⇒ Boolean
11
12
13
|
# File 'app/models/metadata_presenter/flow.rb', line 11
def branch?
type == 'flow.branch'
end
|
#conditionals ⇒ Object
23
24
25
26
27
|
# File 'app/models/metadata_presenter/flow.rb', line 23
def conditionals
Array(metadata['next']['conditionals']).map do |conditional_metadata|
Conditional.new(conditional_metadata)
end
end
|
#default_next ⇒ Object
15
16
17
|
# File 'app/models/metadata_presenter/flow.rb', line 15
def default_next
metadata['next']['default']
end
|
#group_by_page ⇒ Object
29
30
31
|
# File 'app/models/metadata_presenter/flow.rb', line 29
def group_by_page
conditionals.group_by(&:next)
end
|