Class: Bitmovin::Webhooks::WebhookSignature
- Inherits:
-
Object
- Object
- Bitmovin::Webhooks::WebhookSignature
- Defined in:
- lib/bitmovin/webhooks/webhook_signature.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(hash = {}) ⇒ WebhookSignature
constructor
A new instance of WebhookSignature.
- #invalid? ⇒ Boolean
- #to_json(args) ⇒ Object
- #valid? ⇒ Boolean
Constructor Details
#initialize(hash = {}) ⇒ WebhookSignature
Returns a new instance of WebhookSignature.
3 4 5 6 7 8 |
# File 'lib/bitmovin/webhooks/webhook_signature.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
#key ⇒ Object
Returns the value of attribute key.
10 11 12 |
# File 'lib/bitmovin/webhooks/webhook_signature.rb', line 10 def key @key end |
#type ⇒ Object
Returns the value of attribute type.
10 11 12 |
# File 'lib/bitmovin/webhooks/webhook_signature.rb', line 10 def type @type end |
Instance Method Details
#errors ⇒ Object
21 22 23 |
# File 'lib/bitmovin/webhooks/webhook_signature.rb', line 21 def errors @errors end |
#invalid? ⇒ Boolean
17 18 19 |
# File 'lib/bitmovin/webhooks/webhook_signature.rb', line 17 def invalid? !valid? end |
#to_json(args) ⇒ Object
25 26 27 |
# File 'lib/bitmovin/webhooks/webhook_signature.rb', line 25 def to_json(args) collect_attributes.to_json(args) end |
#valid? ⇒ Boolean
12 13 14 15 |
# File 'lib/bitmovin/webhooks/webhook_signature.rb', line 12 def valid? validate! @errors.empty? end |