class Ooz::Model::Ooze
Public Instance Methods
bindings()
click to toggle source
# File lib/ooz/model/ooze.rb, line 63 def bindings forces.reduce([]) do |binds, f| binds + f.bindings end end
bindings_by_field()
click to toggle source
# File lib/ooz/model/ooze.rb, line 69 def bindings_by_field bindings.group_by do |b| b.reference_id end end
fields()
click to toggle source
# File lib/ooz/model/ooze.rb, line 39 def fields membranes end
fields_hash(key: "_id")
click to toggle source
# File lib/ooz/model/ooze.rb, line 43 def fields_hash(key: "_id") to_hash(fields, key: key) end
sections()
click to toggle source
# File lib/ooz/model/ooze.rb, line 47 def sections flow_nodes end
sections_by_field()
click to toggle source
# File lib/ooz/model/ooze.rb, line 55 def sections_by_field sections.map do |sec| sec.field_ids.map do |id| [id, sec] end end.flatten(1).to_h end
sections_hash()
click to toggle source
# File lib/ooz/model/ooze.rb, line 51 def sections_hash to_hash(sections) end
stages()
click to toggle source
# File lib/ooz/model/ooze.rb, line 18 def stages return [] if !stages? evolution.stages end
stages?()
click to toggle source
# File lib/ooz/model/ooze.rb, line 14 def stages? evolution && evolution.stages&.length > 0 end
stages_by_section()
click to toggle source
# File lib/ooz/model/ooze.rb, line 27 def stages_by_section stages.map do |stg| stg.flow_node_ids.map do |id| [id, stg] end end.flatten(1).group_by do |pair| pair.first end.transform_values do |arr_pairs| arr_pairs.map {|pair| pair.last} end end
stages_hash()
click to toggle source
# File lib/ooz/model/ooze.rb, line 23 def stages_hash to_hash(stages) end
tagged?(tag, search_on: :tags)
click to toggle source
# File lib/ooz/model/ooze.rb, line 9 def tagged?(tag, search_on: :tags) haystack = self.send(search_on) haystack.include?(tag) end