Class: Cadenya::Types::CredentialAPIKey

Inherits:
Object
  • Object
show all
Defined in:
lib/cadenya/types.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key: nil) ⇒ CredentialAPIKey

Returns a new instance of CredentialAPIKey.



2065
2066
2067
# File 'lib/cadenya/types.rb', line 2065

def initialize(api_key: nil)
  @api_key = api_key
end

Instance Attribute Details

#api_keyObject (readonly)

Returns the value of attribute api_key.



2063
2064
2065
# File 'lib/cadenya/types.rb', line 2063

def api_key
  @api_key
end

Class Method Details

.from_json(data) ⇒ Object



2069
2070
2071
2072
2073
# File 'lib/cadenya/types.rb', line 2069

def self.from_json(data)
  new(
    api_key: data["apiKey"],
  )
end

Instance Method Details

#to_hObject



2075
2076
2077
2078
2079
# File 'lib/cadenya/types.rb', line 2075

def to_h
  {
    api_key: Util.plain(@api_key),
  }.reject { |_k, v| v.nil? }
end