Method: RubyApp::Element::Event#initialize
- Defined in:
- lib/ruby_app/element.rb
#initialize(data = nil) ⇒ Event
Returns a new instance of Event.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/ruby_app/element.rb', line 28 def initialize(data = nil) if data @now = Time.parse(data['now']) session = RubyApp::Session.get_session(data['session']) raise RubyApp::Exceptions::SessionInvalidException.new(data['session']) unless session @session = session source = RubyApp::Element.get_element(data['source']) raise RubyApp::Exceptions::ElementInvalidException.new(data['source']) unless source @source = source else @now = Time.now @session = nil @source = nil end @delay = 0 @statements = [] end |