Class: Dommy::CookieChangeEvent

Inherits:
Event
  • Object
show all
Defined in:
lib/dommy/cookie_store.rb

Instance Attribute Summary collapse

Attributes inherited from Event

#type

Instance Method Summary collapse

Methods inherited from Event

#__js_call__, #__js_set__, #__prepare_for_dispatch__, #__record_path__, #__set_current_target__, #bubbles?, #default_prevented?, #immediate_propagation_stopped?, #init_event, #propagation_stopped?

Constructor Details

#initialize(type, init = nil) ⇒ CookieChangeEvent

Returns a new instance of CookieChangeEvent.



109
110
111
112
113
# File 'lib/dommy/cookie_store.rb', line 109

def initialize(type, init = nil)
  super
  @changed = Array(read_init(init, "changed") || [])
  @deleted = Array(read_init(init, "deleted") || [])
end

Instance Attribute Details

#changedObject (readonly)

Returns the value of attribute changed.



115
116
117
# File 'lib/dommy/cookie_store.rb', line 115

def changed
  @changed
end

#deletedObject (readonly)

Returns the value of attribute deleted.



115
116
117
# File 'lib/dommy/cookie_store.rb', line 115

def deleted
  @deleted
end

Instance Method Details

#__js_get__(key) ⇒ Object



117
118
119
120
121
122
123
124
125
126
# File 'lib/dommy/cookie_store.rb', line 117

def __js_get__(key)
  case key
  when "changed"
    @changed
  when "deleted"
    @deleted
  else
    super
  end
end