Sha256: 06c3a9ae3f4fd477fff4ba3d235b7b06dbc3fe7b70eac0ee826a322ee5d11c90

Contents?: true

Size: 608 Bytes

Versions: 5

Compression:

Stored size: 608 Bytes

Contents

module Eco
  module API
    module Policies
      class Policy < Eco::API::UseCases::UseCase
        TYPES = [:transform]

        def initialize(name, type: :transform, root:, options: {}, &block)
          raise "Undefine usecase type #{type}. Please, use any of #{TYPES}" unless self.class.valid_type?(type)
          super(name, type: type, root: root, options: options, &block)
        end

        def root=(value)
          raise "Root should be a UsedPolicies object. Given: #{value}" if !value.is_a?(UsedPolicies)
          @root = value
        end

      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
eco-helpers-0.8.3 lib/eco/api/policies/policy.rb
eco-helpers-0.8.2 lib/eco/api/policies/policy.rb
eco-helpers-0.8.1 lib/eco/api/policies/policy.rb
eco-helpers-0.7.2 lib/eco/api/policies/policy.rb
eco-helpers-0.7.1 lib/eco/api/policies/policy.rb