Class: ReactorSDK::Resources::ComprehensiveRule
- Inherits:
-
ComprehensiveResource
- Object
- ComprehensiveResource
- ReactorSDK::Resources::ComprehensiveRule
- Defined in:
- lib/reactor_sdk/resources/comprehensive_rule.rb
Instance Attribute Summary collapse
-
#rule_components ⇒ Object
readonly
Returns the value of attribute rule_components.
Attributes inherited from ComprehensiveResource
Instance Method Summary collapse
- #associated_records ⇒ Object
-
#initialize(resource:, rule_components:) ⇒ ComprehensiveRule
constructor
A new instance of ComprehensiveRule.
- #normalized_payload ⇒ Object
Methods inherited from ComprehensiveResource
Constructor Details
#initialize(resource:, rule_components:) ⇒ ComprehensiveRule
Returns a new instance of ComprehensiveRule.
8 9 10 11 |
# File 'lib/reactor_sdk/resources/comprehensive_rule.rb', line 8 def initialize(resource:, rule_components:) super(resource: resource) @rule_components = Array(rule_components) end |
Instance Attribute Details
#rule_components ⇒ Object (readonly)
Returns the value of attribute rule_components.
6 7 8 |
# File 'lib/reactor_sdk/resources/comprehensive_rule.rb', line 6 def rule_components @rule_components end |
Instance Method Details
#associated_records ⇒ Object
13 14 15 |
# File 'lib/reactor_sdk/resources/comprehensive_rule.rb', line 13 def associated_records @rule_components end |
#normalized_payload ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/reactor_sdk/resources/comprehensive_rule.rb', line 17 def normalized_payload payload = normalized_resource_payload payload['associations'] = { 'rule_components' => @rule_components.map { |component| ReactorSDK::ResourceNormalizer.normalize_resource(component) } } payload end |