Class: Dommy::MediaQueryListEvent

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

Overview

MediaQueryListEvent — the change event payload.

Constant Summary

Constants inherited from Event

Event::AT_TARGET, Event::BUBBLING_PHASE, Event::CAPTURING_PHASE, Event::NONE

Instance Attribute Summary collapse

Attributes inherited from Event

#type

Instance Method Summary collapse

Methods inherited from Event

#__internal_clear_propagation_flags__, #__internal_mark_trusted__, #__internal_prepare_for_dispatch__, #__internal_record_path__, #__internal_run_passive__, #__internal_set_current_target__, #__internal_set_dispatch_flag__, #__internal_set_event_phase__, #__js_call__, #__js_set__, #bubbles?, #default_prevented?, #immediate_propagation_stopped?, #init_event, #propagation_stopped?

Methods included from Bridge::Methods

included

Constructor Details

#initialize(type, init = nil) ⇒ MediaQueryListEvent

Returns a new instance of MediaQueryListEvent.



141
142
143
144
145
# File 'lib/dommy/media_query_list.rb', line 141

def initialize(type, init = nil)
  super
  @matches = !!read_init(init, "matches")
  @media = (read_init(init, "media") || "").to_s
end

Instance Attribute Details

#matchesObject (readonly)

Returns the value of attribute matches.



147
148
149
# File 'lib/dommy/media_query_list.rb', line 147

def matches
  @matches
end

#mediaObject (readonly)

Returns the value of attribute media.



147
148
149
# File 'lib/dommy/media_query_list.rb', line 147

def media
  @media
end

Instance Method Details

#__js_get__(key) ⇒ Object



149
150
151
152
153
154
155
156
157
158
# File 'lib/dommy/media_query_list.rb', line 149

def __js_get__(key)
  case key
  when "matches"
    @matches
  when "media"
    @media
  else
    super
  end
end