Class: Retab::HandlePayload
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Retab::HandlePayload
- Defined in:
- lib/retab/workflow_steps/handle_payload.rb
Constant Summary collapse
- HASH_ATTRS =
{ type: :type, document: :document, data: :data, artifact_ref: :artifact_ref, preview: :preview }.freeze
Instance Attribute Summary collapse
-
#artifact_ref ⇒ Object
Returns the value of attribute artifact_ref.
-
#data ⇒ Object
Returns the value of attribute data.
-
#document ⇒ Object
Returns the value of attribute document.
-
#preview ⇒ Object
Returns the value of attribute preview.
-
#type ⇒ Object
Returns the value of attribute type.
Attributes inherited from Types::BaseModel
Instance Method Summary collapse
-
#initialize(json) ⇒ HandlePayload
constructor
A new instance of HandlePayload.
Methods inherited from Types::BaseModel
#inspect, normalize, #to_h, #to_json
Constructor Details
#initialize(json) ⇒ HandlePayload
Returns a new instance of HandlePayload.
23 24 25 26 27 28 29 30 |
# File 'lib/retab/workflow_steps/handle_payload.rb', line 23 def initialize(json) hash = self.class.normalize(json) @type = hash[:type] @document = hash[:document] ? Retab::FileRef.new(hash[:document]) : nil @data = hash[:data] @artifact_ref = hash[:artifact_ref] || {} @preview = hash[:preview] || {} end |
Instance Attribute Details
#artifact_ref ⇒ Object
Returns the value of attribute artifact_ref.
16 17 18 |
# File 'lib/retab/workflow_steps/handle_payload.rb', line 16 def artifact_ref @artifact_ref end |
#data ⇒ Object
Returns the value of attribute data.
16 17 18 |
# File 'lib/retab/workflow_steps/handle_payload.rb', line 16 def data @data end |
#document ⇒ Object
Returns the value of attribute document.
16 17 18 |
# File 'lib/retab/workflow_steps/handle_payload.rb', line 16 def document @document end |
#preview ⇒ Object
Returns the value of attribute preview.
16 17 18 |
# File 'lib/retab/workflow_steps/handle_payload.rb', line 16 def preview @preview end |
#type ⇒ Object
Returns the value of attribute type.
16 17 18 |
# File 'lib/retab/workflow_steps/handle_payload.rb', line 16 def type @type end |