Class: Cadenya::Types::AccountInfo

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(webhook_events_hmac_secret: nil, challenge_token: nil) ⇒ AccountInfo

Returns a new instance of AccountInfo.



224
225
226
227
# File 'lib/cadenya/types.rb', line 224

def initialize(webhook_events_hmac_secret: nil, challenge_token: nil)
  @webhook_events_hmac_secret = webhook_events_hmac_secret
  @challenge_token = challenge_token
end

Instance Attribute Details

#challenge_tokenObject (readonly)

Returns the value of attribute challenge_token.



222
223
224
# File 'lib/cadenya/types.rb', line 222

def challenge_token
  @challenge_token
end

#webhook_events_hmac_secretObject (readonly)

Returns the value of attribute webhook_events_hmac_secret.



222
223
224
# File 'lib/cadenya/types.rb', line 222

def webhook_events_hmac_secret
  @webhook_events_hmac_secret
end

Class Method Details

.from_json(data) ⇒ Object



229
230
231
232
233
234
# File 'lib/cadenya/types.rb', line 229

def self.from_json(data)
  new(
    webhook_events_hmac_secret: data["webhookEventsHmacSecret"],
    challenge_token: data["challengeToken"],
  )
end

Instance Method Details

#to_hObject



236
237
238
239
240
241
# File 'lib/cadenya/types.rb', line 236

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