lib/eco/api/policies/policy.rb in eco-helpers-0.9.2 vs lib/eco/api/policies/policy.rb in eco-helpers-0.9.3
- old
+ new
@@ -1,17 +1,16 @@
module Eco
module API
- module Policies
+ class Policies
class Policy < Eco::API::UseCases::UseCase
- TYPES = [:transform]
-
+ @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)
+ raise "Root should be a Eco::API::Policies object. Given: #{value}" if !value.is_a?(Eco::API::Policies)
@root = value
end
end
end