Class: Bitmovin::Webhooks::WebhookEncryption

Inherits:
Object
  • Object
show all
Defined in:
lib/bitmovin/webhooks/webhook_encryption.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash = {}) ⇒ WebhookEncryption

Returns a new instance of WebhookEncryption.



3
4
5
6
7
8
# File 'lib/bitmovin/webhooks/webhook_encryption.rb', line 3

def initialize(hash = {})
  @errors = []
  hash.each do |name, value|
    instance_variable_set("@#{ActiveSupport::Inflector.underscore(name)}", value)
  end
end

Instance Attribute Details

#keyObject

Returns the value of attribute key.



10
11
12
# File 'lib/bitmovin/webhooks/webhook_encryption.rb', line 10

def key
  @key
end

#typeObject

Returns the value of attribute type.



10
11
12
# File 'lib/bitmovin/webhooks/webhook_encryption.rb', line 10

def type
  @type
end

Instance Method Details

#errorsObject



21
22
23
# File 'lib/bitmovin/webhooks/webhook_encryption.rb', line 21

def errors
  @errors
end

#invalid?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/bitmovin/webhooks/webhook_encryption.rb', line 17

def invalid?
  !valid?
end

#to_json(args) ⇒ Object



25
26
27
# File 'lib/bitmovin/webhooks/webhook_encryption.rb', line 25

def to_json(args)
  collect_attributes.to_json(args)
end

#valid?Boolean

Returns:

  • (Boolean)


12
13
14
15
# File 'lib/bitmovin/webhooks/webhook_encryption.rb', line 12

def valid?
  validate!
  @errors.empty?
end