Class: Conjoin::Widgets::Events

Inherits:
Struct
  • Object
show all
Includes:
Observable
Defined in:
lib/conjoin/widgets.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



115
116
117
# File 'lib/conjoin/widgets.rb', line 115

def req
  @req
end

#resObject

Returns the value of attribute res

Returns:

  • (Object)

    the current value of res



115
116
117
# File 'lib/conjoin/widgets.rb', line 115

def res
  @res
end

#settingsObject

Returns the value of attribute settings

Returns:

  • (Object)

    the current value of settings



115
116
117
# File 'lib/conjoin/widgets.rb', line 115

def settings
  @settings
end

Instance Method Details

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



118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/conjoin/widgets.rb', line 118

def trigger event, widget_name, user_data = {}
  # data = OpenStruct.new({
  #   settings: settings,
  #   data: user_data
  # })
  data = user_data.to_ostruct

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

  notify_observers event, widget_name, data
end