Method: Comet::EventListener#initialize
- Defined in:
- lib/comet-html/parser-binding.rb
#initialize(el, parent, key, value) ⇒ EventListener
Returns a new instance of EventListener.
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/comet-html/parser-binding.rb', line 7 def initialize el, parent, key, value @el = el @parent = parent @is_cpp = key.start_with?("cpp::") @attribute_name = key.delete_suffix(".trigger") @attribute_name = @attribute_name[5..-1] if is_cpp @code = value if @parent.find_reference_for(el).nil? @parent.refs << (Reference.new(el, @parent)) end end |