class Ecoportal::API::V2::Page::Stages

Public Instance Methods

get_by_name(name) click to toggle source
# File lib/ecoportal/api/v2/page/stages.rb, line 10
def get_by_name(name)
  find do |stage|
    stage.name.strip.downcase == name.to_s.strip.downcase
  end
end
ordered_stages() click to toggle source
# File lib/ecoportal/api/v2/page/stages.rb, line 16
def ordered_stages
  stages.each_with_index.sort_by do |stage, index|
    (stage.ordering >= 9999) ? [index, index] : [stage.ordering, index]
  end.map(&:first)
end