class Ecoportal::API::V2::Page::Stage

Public Instance Methods

add_section(*secs) click to toggle source
# File lib/ecoportal/api/v2/page/stage.rb, line 28
def add_section(*secs)
  secs.each {|sec| section_ids.insert_one(sec.id)}
  self
end
sections() { |sec| ... } click to toggle source
# File lib/ecoportal/api/v2/page/stage.rb, line 20
def sections
  sec_ids = section_ids.to_a
  root.sections.values_at(*sec_ids).select.with_index do |sec, i|
    puts "Warning: section #{id} points to missing section #{sec_ids[i]}" if !sec
    fld && (!block_given? || yield(sec))
  end.sort_by.with_index {|sec, index| [sec.weight, index]}
end