Class: Eco::API::Policies::Policy

Inherits:
UseCases::UseCase show all
Defined in:
lib/eco/api/policies/policy.rb

Instance Attribute Summary

Attributes inherited from UseCases::UseCase

#name, #options, #times_launched, #type

Instance Method Summary collapse

Methods inherited from UseCases::UseCase

#chainer, #launch

Methods inherited from UseCases::BaseCase

valid_type?, validate_type

Methods included from Common::ClassHelpers

#class_resolver, #descendants, #descendants?, #new_class, #resolve_class, #to_constant

Constructor Details

#initialize(name, type: :transform, root:, &block) ⇒ Policy

Returns a new instance of Policy.



7
8
9
# File 'lib/eco/api/policies/policy.rb', line 7

def initialize(name, type: :transform, root:, &block)
  super(name, type: type, root: root, &block)
end

Instance Method Details

#root=(value) ⇒ Object



11
12
13
14
# File 'lib/eco/api/policies/policy.rb', line 11

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