Class: ActiveSpy::Rails::Validation::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/active_spy/rails/validation.rb

Overview

Class responsible to validate event that are send to event-runner instances.

Instance Method Summary collapse

Constructor Details

#initialize(event_json) ⇒ Event

Returns a new instance of Event.



13
14
15
# File 'lib/active_spy/rails/validation.rb', line 13

def initialize(event_json)
  @event = JSON.load(event_json)
end

Instance Method Details

#validate!Object

Validates the event_json provided in the initializer

(see #initialize)



20
21
22
23
# File 'lib/active_spy/rails/validation.rb', line 20

def validate!
  check_actor_key(@event['event']['actor'])
  check_realm_key(@event['event']['realm'])
end