Class: React::SyntheticEvent
- Includes:
- Native::Wrapper
- Defined in:
- lib/react/synthetic_event.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.native_accessors(*js_names) ⇒ Object
helpers
5 6 7 8 9 10 11 12 |
# File 'lib/react/synthetic_event.rb', line 5 def self.native_accessors(*js_names) js_names.each do |js_name| ruby_name = js_name.underscore define_method(ruby_name) do @native.JS[js_name] end end end |
.native_boolean_accessors(*js_names) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/react/synthetic_event.rb', line 14 def self.native_boolean_accessors(*js_names) js_names.each do |js_name| ruby_name = js_name.underscore + '?' define_method(ruby_name) do @native.JS[js_name] end end end |
Instance Method Details
#current_target ⇒ Object
37 38 39 |
# File 'lib/react/synthetic_event.rb', line 37 def current_target Browser::Element.new(@native.JS[:currentTarget]) end |
#native_event ⇒ Object
41 42 43 |
# File 'lib/react/synthetic_event.rb', line 41 def native_event Browser::Event.new(@native.JS[:nativeEvent]) end |