Class: MetadataPresenter::Flow
- Defined in:
- app/models/metadata_presenter/flow.rb
Instance Attribute Summary collapse
-
#uuid ⇒ Object
readonly
Returns the value of attribute uuid.
Attributes inherited from Metadata
Instance Method Summary collapse
- #branch? ⇒ Boolean
- #conditionals ⇒ Object
- #default_next ⇒ Object
- #group_by_page ⇒ Object
-
#initialize(uuid, flow) ⇒ Flow
constructor
A new instance of Flow.
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 |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class MetadataPresenter::Metadata
Instance Attribute Details
#uuid ⇒ Object (readonly)
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
#branch? ⇒ Boolean
11 12 13 |
# File 'app/models/metadata_presenter/flow.rb', line 11 def branch? type == 'flow.branch' end |
#conditionals ⇒ Object
19 20 21 22 23 |
# File 'app/models/metadata_presenter/flow.rb', line 19 def conditionals Array(['next']['conditionals']).map do || Conditional.new() end end |
#default_next ⇒ Object
15 16 17 |
# File 'app/models/metadata_presenter/flow.rb', line 15 def default_next ['next']['default'] end |
#group_by_page ⇒ Object
25 26 27 |
# File 'app/models/metadata_presenter/flow.rb', line 25 def group_by_page conditionals.group_by(&:next) end |