Class: LockstepSdk::CodeDefinitionModel
- Inherits:
-
Object
- Object
- LockstepSdk::CodeDefinitionModel
- Defined in:
- lib/lockstep_sdk/models/code_definition_model.rb
Overview
Represents a Code Definition. Codes can be used as shortened, human readable strings. Additionally, this table can be used to store lists of system values for Lockstep objects.
Instance Attribute Summary collapse
-
#code ⇒ String
The Code to be defined.
-
#code_definition_id ⇒ Uuid
The unique ID of this record, automatically assigned by Lockstep when this record is added to the Lockstep platform.
-
#code_description ⇒ String
The definition of the Code.
-
#code_type ⇒ String
The type of the Code Definition.
-
#created ⇒ Date-time
The date that the Code Definition was created.
-
#created_user_id ⇒ Uuid
The ID of the user who created the Code Definition.
-
#group_key ⇒ Uuid
The GroupKey uniquely identifies a single Lockstep Platform account.
-
#modified ⇒ Date-time
The date the Code Definition was last modified.
-
#modified_user_id ⇒ Uuid
The ID of the user who last modified the Code Definition.
Instance Method Summary collapse
-
#as_json(options = {}) ⇒ object
This object as a JSON key-value structure.
-
#initialize(params = {}) ⇒ CodeDefinitionModel
constructor
Initialize the CodeDefinitionModel using the provided prototype.
-
#to_json(*options) ⇒ String
This object converted to a JSON string.
Constructor Details
#initialize(params = {}) ⇒ CodeDefinitionModel
Initialize the CodeDefinitionModel using the provided prototype
29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/lockstep_sdk/models/code_definition_model.rb', line 29 def initialize(params = {}) @code_definition_id = params.dig(:code_definition_id) @group_key = params.dig(:group_key) @code_type = params.dig(:code_type) @code = params.dig(:code) @code_description = params.dig(:code_description) @created = params.dig(:created) @created_user_id = params.dig(:created_user_id) @modified = params.dig(:modified) @modified_user_id = params.dig(:modified_user_id) end |
Instance Attribute Details
#code ⇒ String
Returns The Code to be defined.
55 56 57 |
# File 'lib/lockstep_sdk/models/code_definition_model.rb', line 55 def code @code end |
#code_definition_id ⇒ Uuid
Returns The unique ID of this record, automatically assigned by Lockstep when this record is added to the Lockstep platform.
43 44 45 |
# File 'lib/lockstep_sdk/models/code_definition_model.rb', line 43 def code_definition_id @code_definition_id end |
#code_description ⇒ String
Returns The definition of the Code.
59 60 61 |
# File 'lib/lockstep_sdk/models/code_definition_model.rb', line 59 def code_description @code_description end |
#code_type ⇒ String
Returns The type of the Code Definition.
51 52 53 |
# File 'lib/lockstep_sdk/models/code_definition_model.rb', line 51 def code_type @code_type end |
#created ⇒ Date-time
Returns The date that the Code Definition was created.
63 64 65 |
# File 'lib/lockstep_sdk/models/code_definition_model.rb', line 63 def created @created end |
#created_user_id ⇒ Uuid
Returns The ID of the user who created the Code Definition.
67 68 69 |
# File 'lib/lockstep_sdk/models/code_definition_model.rb', line 67 def created_user_id @created_user_id end |
#group_key ⇒ Uuid
Returns The GroupKey uniquely identifies a single Lockstep Platform account. All records for this account will share the same GroupKey value. GroupKey values cannot be changed once created. For more information, see [Accounts and GroupKeys](developer.lockstep.io/docs/accounts-and-groupkeys).
47 48 49 |
# File 'lib/lockstep_sdk/models/code_definition_model.rb', line 47 def group_key @group_key end |
#modified ⇒ Date-time
Returns The date the Code Definition was last modified.
71 72 73 |
# File 'lib/lockstep_sdk/models/code_definition_model.rb', line 71 def modified @modified end |
#modified_user_id ⇒ Uuid
Returns The ID of the user who last modified the Code Definition.
75 76 77 |
# File 'lib/lockstep_sdk/models/code_definition_model.rb', line 75 def modified_user_id @modified_user_id end |
Instance Method Details
#as_json(options = {}) ⇒ object
Returns This object as a JSON key-value structure.
79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/lockstep_sdk/models/code_definition_model.rb', line 79 def as_json(={}) { 'codeDefinitionId' => @code_definition_id, 'groupKey' => @group_key, 'codeType' => @code_type, 'code' => @code, 'codeDescription' => @code_description, 'created' => @created, 'createdUserId' => @created_user_id, 'modified' => @modified, 'modifiedUserId' => @modified_user_id, } end |
#to_json(*options) ⇒ String
Returns This object converted to a JSON string.
95 96 97 |
# File 'lib/lockstep_sdk/models/code_definition_model.rb', line 95 def to_json(*) "[#{as_json(*).to_json(*)}]" end |