Class: Retab::Workflow
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Retab::Workflow
- Defined in:
- lib/retab/workflows/workflow.rb
Constant Summary collapse
- HASH_ATTRS =
{ id: :id, name: :name, description: :description, project_id: :project_id, published: :published, created_at: :created_at, updated_at: :updated_at, capabilities: :capabilities, authz_status: :authz_status }.freeze
Instance Attribute Summary collapse
-
#authz_status ⇒ Object
Returns the value of attribute authz_status.
-
#capabilities ⇒ Object
Returns the value of attribute capabilities.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#description ⇒ Object
Returns the value of attribute description.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#project_id ⇒ Object
Returns the value of attribute project_id.
-
#published ⇒ Object
Returns the value of attribute published.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
Attributes inherited from Types::BaseModel
Instance Method Summary collapse
-
#initialize(json) ⇒ Workflow
constructor
A new instance of Workflow.
Methods inherited from Types::BaseModel
deep_symbolize, #inspect, normalize, #to_h, #to_json
Constructor Details
#initialize(json) ⇒ Workflow
Returns a new instance of Workflow.
32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/retab/workflows/workflow.rb', line 32 def initialize(json) super() hash = self.class.normalize(json) @id = hash[:id] @name = hash[:name].nil? ? "Untitled Workflow" : hash[:name] @description = hash[:description].nil? ? "" : hash[:description] @project_id = hash[:project_id] @published = hash[:published] ? Retab::WorkflowPublished.new(hash[:published]) : nil @created_at = hash[:created_at] @updated_at = hash[:updated_at] @capabilities = (hash[:capabilities] || []) @authz_status = hash[:authz_status] end |
Instance Attribute Details
#authz_status ⇒ Object
Returns the value of attribute authz_status.
20 21 22 |
# File 'lib/retab/workflows/workflow.rb', line 20 def authz_status @authz_status end |
#capabilities ⇒ Object
Returns the value of attribute capabilities.
20 21 22 |
# File 'lib/retab/workflows/workflow.rb', line 20 def capabilities @capabilities end |
#created_at ⇒ Object
Returns the value of attribute created_at.
20 21 22 |
# File 'lib/retab/workflows/workflow.rb', line 20 def created_at @created_at end |
#description ⇒ Object
Returns the value of attribute description.
20 21 22 |
# File 'lib/retab/workflows/workflow.rb', line 20 def description @description end |
#id ⇒ Object
Returns the value of attribute id.
20 21 22 |
# File 'lib/retab/workflows/workflow.rb', line 20 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
20 21 22 |
# File 'lib/retab/workflows/workflow.rb', line 20 def name @name end |
#project_id ⇒ Object
Returns the value of attribute project_id.
20 21 22 |
# File 'lib/retab/workflows/workflow.rb', line 20 def project_id @project_id end |
#published ⇒ Object
Returns the value of attribute published.
20 21 22 |
# File 'lib/retab/workflows/workflow.rb', line 20 def published @published end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
20 21 22 |
# File 'lib/retab/workflows/workflow.rb', line 20 def updated_at @updated_at end |