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_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.



105
106
107
108
109
# File 'lib/dommy/media_query_list.rb', line 105

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.



111
112
113
# File 'lib/dommy/media_query_list.rb', line 111

def matches
  @matches
end

#mediaObject (readonly)

Returns the value of attribute media.



111
112
113
# File 'lib/dommy/media_query_list.rb', line 111

def media
  @media
end

Instance Method Details

#__js_get__(key) ⇒ Object



113
114
115
116
117
118
119
120
121
122
# File 'lib/dommy/media_query_list.rb', line 113

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