Class: Bosh::Director::Models::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/bosh/director/models/event.rb

Instance Method Summary collapse

Instance Method Details

#contextObject



9
10
11
12
# File 'lib/bosh/director/models/event.rb', line 9

def context
  return {} if context_json.nil?
  JSON.parse(context_json)
end

#context=(data) ⇒ Object



14
15
16
# File 'lib/bosh/director/models/event.rb', line 14

def context=(data)
  self.context_json = JSON.generate(data)
end

#validateObject



5
6
7
# File 'lib/bosh/director/models/event.rb', line 5

def validate
  validates_presence [:timestamp, :action, :object_type]
end