Sha256: a9ea6c28581ec16b46b8c709c89b39fa4a63af802a59681c5f615686e4aee57a

Contents?: true

Size: 596 Bytes

Versions: 2

Compression:

Stored size: 596 Bytes

Contents

module Ecoportal
  module API
    class V2
      class Page
        class Stages < Common::Content::CollectionModel
          class_resolver :stage_class, "Ecoportal::API::V2::Page::Stage"

          self.klass = :stage_class

          def get_by_name(name)
            find do |stage|
              stage.name.strip.downcase == name.to_s.strip.downcase
            end
          end

          def sections
            section_ids.map do |id|
              root.sections.find {|sec| sec.id == id}
            end
          end

        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ecoportal-api-oozes-0.5.7 lib/ecoportal/api/v2/page/stages.rb
ecoportal-api-oozes-0.5.6 lib/ecoportal/api/v2/page/stages.rb