Class: Hecks::Bluebook::Policy

Inherits:
Object
  • Object
show all
Includes:
Behaviour::Policy, IR
Defined in:
lib/hecks/bluebook/policy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Behaviour::Policy

#event_name, #event_qualifier, #fans_out?, #for_each_route, #guarded?, #hecks_name

Methods included from IR

extended, included

Constructor Details

#initialize(name:, on_event: nil, trigger_command: nil, target_domain: nil, where: nil, for_each: nil, with_spec: [], aggregate: nil) ⇒ Policy

Returns a new instance of Policy.



29
30
31
32
33
34
35
36
37
38
# File 'lib/hecks/bluebook/policy.rb', line 29

def initialize(name:, on_event: nil, trigger_command: nil, target_domain: nil, where: nil, for_each: nil, with_spec: [], aggregate: nil)
  @name = name.to_s
  @on_event = on_event
  @trigger_command = trigger_command
  @target_domain = target_domain
  @where = where
  @for_each = for_each
  @with_spec = with_spec
  @aggregate = aggregate&.to_s
end

Instance Attribute Details

#aggregateObject

AGGREGATE, DECLARED AND DELIBERATELY OFF THE WIRE the wire format is a pinned contract, and it does not carry where a policy was written before the builder hoisted it



27
28
29
# File 'lib/hecks/bluebook/policy.rb', line 27

def aggregate
  @aggregate
end

#for_eachObject (readonly)

Returns the value of attribute for_each.



22
23
24
# File 'lib/hecks/bluebook/policy.rb', line 22

def for_each
  @for_each
end

#nameObject (readonly)

Returns the value of attribute name.



22
23
24
# File 'lib/hecks/bluebook/policy.rb', line 22

def name
  @name
end

#on_eventObject (readonly)

Returns the value of attribute on_event.



22
23
24
# File 'lib/hecks/bluebook/policy.rb', line 22

def on_event
  @on_event
end

#target_domainObject (readonly)

Returns the value of attribute target_domain.



22
23
24
# File 'lib/hecks/bluebook/policy.rb', line 22

def target_domain
  @target_domain
end

#trigger_commandObject (readonly)

Returns the value of attribute trigger_command.



22
23
24
# File 'lib/hecks/bluebook/policy.rb', line 22

def trigger_command
  @trigger_command
end

#whereObject (readonly)

Returns the value of attribute where.



22
23
24
# File 'lib/hecks/bluebook/policy.rb', line 22

def where
  @where
end

#with_specObject (readonly)

Returns the value of attribute with_spec.



22
23
24
# File 'lib/hecks/bluebook/policy.rb', line 22

def with_spec
  @with_spec
end