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

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

Constant Summary collapse

TYPES =
[:transform].freeze

Constants included from UseCases::BaseCase::Model

UseCases::BaseCase::Model::MODELS

Instance Attribute Summary

Attributes inherited from UseCases::UseCase

#model, #name, #options, #times_launched, #type

Instance Method Summary collapse

Methods inherited from UseCases::UseCase

#classed_definition, #launch, #source_object

Methods included from UseCases::UseCase::Chainer

#chainer

Methods included from Language::Klass::InheritableClassVars

#inheritable_attrs, #inheritable_class_vars, #inherited

Methods included from Language::Klass::Naming

#instance_variable_name, #to_constant

Methods included from Language::Klass::Hierarchy

#descendants, #descendants?

Methods included from Language::Klass::Builder

#new_class

Methods included from Language::Klass::Uid

#uid

Methods included from Language::Klass::Resolver

#class_resolver, #resolve_class

Methods included from Language::Klass::Const

#if_const, #redef_without_warning

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
end

Instance Method Details

#root=(value) ⇒ Object

Raises:

  • (ArgumentError)


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

def root=(value)
  msg  = "Root should be a Eco::API::Policies object. "
  msg << "Given: #{value.class}"
  raise ArgumentError, msg unless value.is_a?(Eco::API::Policies)

  @root = value
end