Class: Cuba::Tools::Widget::Events

Inherits:
Struct
  • Object
show all
Includes:
Observable
Defined in:
lib/cuba/tools/widget/events.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#reqObject

Returns the value of attribute req

Returns:

  • (Object)

    the current value of req



5
6
7
# File 'lib/cuba/tools/widget/events.rb', line 5

def req
  @req
end

#resObject

Returns the value of attribute res

Returns:

  • (Object)

    the current value of res



5
6
7
# File 'lib/cuba/tools/widget/events.rb', line 5

def res
  @res
end

Instance Method Details

#trigger(widget_name, widget_event, user_data = {}) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/cuba/tools/widget/events.rb', line 8

def trigger widget_name, widget_event, user_data = {}
  data = user_data.to_deep_ostruct

  # THIS IS WHAT WILL MAKE SURE EVENTS ARE TRIGGERED
  changed
  ##################################################

  notify_observers widget_name, widget_event, data
end