Sha256: 7f73a25bb5e52220517857bc1a5513f8d843eb82e6cfe0eaf9ffd848ae8372fe

Contents?: true

Size: 577 Bytes

Versions: 3

Compression:

Stored size: 577 Bytes

Contents

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

        def initialize(name, type: :transform, root:, &block)
          raise "Undefine usecase type #{type}. Please, use any of #{TYPES}" unless self.class.valid_type?(type)
          super(name, type: type, root: root, &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

3 entries across 3 versions & 1 rubygems

Version Path
eco-helpers-0.9.2 lib/eco/api/policies/policy.rb
eco-helpers-0.9.1 lib/eco/api/policies/policy.rb
eco-helpers-0.8.4 lib/eco/api/policies/policy.rb