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, published: :published, email_trigger: :email_trigger, created_at: :created_at, updated_at: :updated_at }.freeze
Instance Attribute Summary collapse
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#description ⇒ Object
Returns the value of attribute description.
-
#email_trigger ⇒ Object
Returns the value of attribute email_trigger.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#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
#inspect, normalize, #to_h, #to_json
Constructor Details
#initialize(json) ⇒ Workflow
Returns a new instance of Workflow.
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/retab/workflows/workflow.rb', line 27 def initialize(json) hash = self.class.normalize(json) @id = hash[:id] @name = hash[:name] @description = hash[:description] @published = hash[:published] ? Retab::WorkflowPublished.new(hash[:published]) : nil @email_trigger = hash[:email_trigger] ? Retab::WorkflowEmailTrigger.new(hash[:email_trigger]) : nil @created_at = hash[:created_at] @updated_at = hash[:updated_at] end |
Instance Attribute Details
#created_at ⇒ Object
Returns the value of attribute created_at.
18 19 20 |
# File 'lib/retab/workflows/workflow.rb', line 18 def created_at @created_at end |
#description ⇒ Object
Returns the value of attribute description.
18 19 20 |
# File 'lib/retab/workflows/workflow.rb', line 18 def description @description end |
#email_trigger ⇒ Object
Returns the value of attribute email_trigger.
18 19 20 |
# File 'lib/retab/workflows/workflow.rb', line 18 def email_trigger @email_trigger end |
#id ⇒ Object
Returns the value of attribute id.
18 19 20 |
# File 'lib/retab/workflows/workflow.rb', line 18 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
18 19 20 |
# File 'lib/retab/workflows/workflow.rb', line 18 def name @name end |
#published ⇒ Object
Returns the value of attribute published.
18 19 20 |
# File 'lib/retab/workflows/workflow.rb', line 18 def published @published end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
18 19 20 |
# File 'lib/retab/workflows/workflow.rb', line 18 def updated_at @updated_at end |