Sha256: b775a0abdaaae32173c83043cba14cab3a361a2325a4b16174194b919d2b0a3c

Contents?: true

Size: 1.19 KB

Versions: 18

Compression:

Stored size: 1.19 KB

Contents

module Ecoportal
  module API
    class V2
      class Page
        class Component
          class ActionsField < Page::Component
            passboolean :create_actions
            passthrough :required_completed
            passboolean :filled_in?
            passarray   :permitted_person_schema_ids, order_matters: false

            passboolean :enable_attaching_actions
            passarray   :action_ids, :all_actions, order_matters: false
            passarray   :open_actions, :closed_actions, :overdue_actions, order_matters: false
            passthrough :actions_hash
            passarray   :action_recurrence_ids, order_matters: false

            def empty?
              action_ids.to_a.empty?
            end

            # Adds a task with `name` short description
            # @return [Ecoportal::API::V2::Page::Component::Action]
            def attach_action (*ids, force: false)
              raise "Can't attach actions" unless enable_attaching_actions && force
              action_ids << ids
            end

            def to_s(delimiter: "\n")
              action_ids.join(delimiter)
            end
          end
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
ecoportal-api-v2-2.0.12 lib/ecoportal/api/v2/page/component/actions_field.rb
ecoportal-api-v2-2.0.11 lib/ecoportal/api/v2/page/component/actions_field.rb
ecoportal-api-v2-2.0.10 lib/ecoportal/api/v2/page/component/actions_field.rb
ecoportal-api-v2-2.0.9 lib/ecoportal/api/v2/page/component/actions_field.rb
ecoportal-api-v2-2.0.8 lib/ecoportal/api/v2/page/component/actions_field.rb
ecoportal-api-v2-2.0.7 lib/ecoportal/api/v2/page/component/actions_field.rb
ecoportal-api-v2-2.0.6 lib/ecoportal/api/v2/page/component/actions_field.rb
ecoportal-api-v2-2.0.5 lib/ecoportal/api/v2/page/component/actions_field.rb
ecoportal-api-v2-2.0.4 lib/ecoportal/api/v2/page/component/actions_field.rb
ecoportal-api-v2-2.0.3 lib/ecoportal/api/v2/page/component/actions_field.rb
ecoportal-api-v2-2.0.2 lib/ecoportal/api/v2/page/component/actions_field.rb
ecoportal-api-v2-2.0.1 lib/ecoportal/api/v2/page/component/actions_field.rb
ecoportal-api-v2-2.0.0 lib/ecoportal/api/v2/page/component/actions_field.rb
ecoportal-api-v2-1.1.8 lib/ecoportal/api/v2/page/component/actions_field.rb
ecoportal-api-v2-1.1.7 lib/ecoportal/api/v2/page/component/actions_field.rb
ecoportal-api-v2-1.1.6 lib/ecoportal/api/v2/page/component/actions_field.rb
ecoportal-api-v2-1.1.5 lib/ecoportal/api/v2/page/component/actions_field.rb
ecoportal-api-v2-1.1.4 lib/ecoportal/api/v2/page/component/actions_field.rb