Class: KeeperSecretsManager::Dto::BasePayload

Inherits:
Object
  • Object
show all
Defined in:
lib/keeper_secrets_manager/dto/payload.rb

Overview

Base payload class

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#client_idObject

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_versionObject

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_hObject



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