Class: Dommy::MediaQueryListEvent
- 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
-
#matches ⇒ Object
readonly
Returns the value of attribute matches.
-
#media ⇒ Object
readonly
Returns the value of attribute media.
Attributes inherited from Event
Instance Method Summary collapse
- #__js_get__(key) ⇒ Object
-
#initialize(type, init = nil) ⇒ MediaQueryListEvent
constructor
A new instance of MediaQueryListEvent.
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
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
#matches ⇒ Object (readonly)
Returns the value of attribute matches.
111 112 113 |
# File 'lib/dommy/media_query_list.rb', line 111 def matches @matches end |
#media ⇒ Object (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 |