Class: KeeperSecretsManager::Dto::BasePayload
- Inherits:
-
Object
- Object
- KeeperSecretsManager::Dto::BasePayload
- Defined in:
- lib/keeper_secrets_manager/dto/payload.rb
Overview
Base payload class
Direct Known Subclasses
CompleteTransactionPayload, CreateFolderPayload, CreatePayload, DeleteFolderPayload, DeletePayload, FileUploadPayload, GetPayload, UpdateFolderPayload, UpdatePayload
Instance Attribute Summary collapse
-
#client_id ⇒ Object
Returns the value of attribute client_id.
-
#client_version ⇒ Object
Returns the value of attribute client_version.
Instance Method Summary collapse
Instance Attribute Details
#client_id ⇒ Object
Returns the value of attribute client_id.
16 17 18 |
# File 'lib/keeper_secrets_manager/dto/payload.rb', line 16 def client_id @client_id end |
#client_version ⇒ Object
Returns the value of attribute client_version.
16 17 18 |
# File 'lib/keeper_secrets_manager/dto/payload.rb', line 16 def client_version @client_version end |
Instance Method Details
#to_h ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/keeper_secrets_manager/dto/payload.rb', line 18 def to_h hash = {} instance_variables.each do |var| key = var.to_s.delete('@') value = instance_variable_get(var) # Convert Ruby snake_case to camelCase for API api_key = Utils.snake_to_camel(key) hash[api_key] = value unless value.nil? end hash end |
#to_json(*args) ⇒ Object
31 32 33 |
# File 'lib/keeper_secrets_manager/dto/payload.rb', line 31 def to_json(*args) to_h.to_json(*args) end |