Class: Phronomy::Agent::DerivedContentSpec
- Inherits:
-
Data
- Object
- Data
- Phronomy::Agent::DerivedContentSpec
- Defined in:
- lib/phronomy/agent/derived_content_spec.rb
Instance Attribute Summary collapse
-
#category ⇒ Object
readonly
Returns the value of attribute category.
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#content_format ⇒ Object
readonly
Returns the value of attribute content_format.
-
#coverage_candidate_ids ⇒ Object
readonly
Returns the value of attribute coverage_candidate_ids.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#role ⇒ Object
readonly
Returns the value of attribute role.
-
#source_content_refs ⇒ Object
readonly
Returns the value of attribute source_content_refs.
-
#source_record_ids ⇒ Object
readonly
Returns the value of attribute source_record_ids.
-
#transformer_id ⇒ Object
readonly
Returns the value of attribute transformer_id.
-
#transformer_version ⇒ Object
readonly
Returns the value of attribute transformer_version.
Instance Method Summary collapse
-
#initialize(**values) ⇒ DerivedContentSpec
constructor
A new instance of DerivedContentSpec.
Constructor Details
#initialize(**values) ⇒ DerivedContentSpec
Returns a new instance of DerivedContentSpec.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/phronomy/agent/derived_content_spec.rb', line 17 def initialize(**values) super(**values.merge( content: Immutable.copy(values[:content]), content_format: values.fetch(:content_format).to_sym, category: values.fetch(:category).to_sym, role: values[:role]&.to_sym, coverage_candidate_ids: Array(values[:coverage_candidate_ids]).map(&:to_s).freeze, source_record_ids: Array(values[:source_record_ids]).map(&:to_s).freeze, source_content_refs: Array(values[:source_content_refs]).map(&:to_s).freeze, transformer_id: values.fetch(:transformer_id).to_s.freeze, transformer_version: Integer(values.fetch(:transformer_version)), metadata: Immutable.copy(values[:metadata] || {}) )) freeze end |
Instance Attribute Details
#category ⇒ Object (readonly)
Returns the value of attribute category
5 6 7 |
# File 'lib/phronomy/agent/derived_content_spec.rb', line 5 def category @category end |
#content ⇒ Object (readonly)
Returns the value of attribute content
5 6 7 |
# File 'lib/phronomy/agent/derived_content_spec.rb', line 5 def content @content end |
#content_format ⇒ Object (readonly)
Returns the value of attribute content_format
5 6 7 |
# File 'lib/phronomy/agent/derived_content_spec.rb', line 5 def content_format @content_format end |
#coverage_candidate_ids ⇒ Object (readonly)
Returns the value of attribute coverage_candidate_ids
5 6 7 |
# File 'lib/phronomy/agent/derived_content_spec.rb', line 5 def coverage_candidate_ids @coverage_candidate_ids end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata
5 6 7 |
# File 'lib/phronomy/agent/derived_content_spec.rb', line 5 def @metadata end |
#role ⇒ Object (readonly)
Returns the value of attribute role
5 6 7 |
# File 'lib/phronomy/agent/derived_content_spec.rb', line 5 def role @role end |
#source_content_refs ⇒ Object (readonly)
Returns the value of attribute source_content_refs
5 6 7 |
# File 'lib/phronomy/agent/derived_content_spec.rb', line 5 def source_content_refs @source_content_refs end |
#source_record_ids ⇒ Object (readonly)
Returns the value of attribute source_record_ids
5 6 7 |
# File 'lib/phronomy/agent/derived_content_spec.rb', line 5 def source_record_ids @source_record_ids end |
#transformer_id ⇒ Object (readonly)
Returns the value of attribute transformer_id
5 6 7 |
# File 'lib/phronomy/agent/derived_content_spec.rb', line 5 def transformer_id @transformer_id end |
#transformer_version ⇒ Object (readonly)
Returns the value of attribute transformer_version
5 6 7 |
# File 'lib/phronomy/agent/derived_content_spec.rb', line 5 def transformer_version @transformer_version end |