Sha256: eef1a21b847cb76c9bb194fa21efe7d0d4b372d52dd50c963e6264503005eb17

Contents?: true

Size: 782 Bytes

Versions: 14

Compression:

Stored size: 782 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 ooze
            self._parent.ooze
          end

          # @param name [String, Regexp] the `name` of the stage to find.
          # @return [Ecoportal::API::V2::Page::Stage, nil]
          def get_by_name(name)
            self.find do |stage|
              same_string?(stage.name, name)
            end
          end

          def ordered
            self.sort_by.with_index do |stage, index|
              [stage.ordering, index]
            end
          end

        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
ecoportal-api-v2-0.9.1 lib/ecoportal/api/v2/page/stages.rb
ecoportal-api-v2-0.8.33 lib/ecoportal/api/v2/page/stages.rb
ecoportal-api-v2-0.8.32 lib/ecoportal/api/v2/page/stages.rb
ecoportal-api-v2-0.8.31 lib/ecoportal/api/v2/page/stages.rb
ecoportal-api-v2-0.8.30 lib/ecoportal/api/v2/page/stages.rb
ecoportal-api-v2-0.8.29 lib/ecoportal/api/v2/page/stages.rb
ecoportal-api-v2-0.8.28 lib/ecoportal/api/v2/page/stages.rb
ecoportal-api-v2-0.8.27 lib/ecoportal/api/v2/page/stages.rb
ecoportal-api-v2-0.8.26 lib/ecoportal/api/v2/page/stages.rb
ecoportal-api-v2-0.8.25 lib/ecoportal/api/v2/page/stages.rb
ecoportal-api-v2-0.8.24 lib/ecoportal/api/v2/page/stages.rb
ecoportal-api-v2-0.8.23 lib/ecoportal/api/v2/page/stages.rb
ecoportal-api-v2-0.8.22 lib/ecoportal/api/v2/page/stages.rb
ecoportal-api-v2-0.8.21 lib/ecoportal/api/v2/page/stages.rb