Class: Comet::EventListener
- Inherits:
-
Object
- Object
- Comet::EventListener
- Defined in:
- lib/comet-html/parser-binding.rb
Instance Attribute Summary collapse
-
#attribute_name ⇒ Object
readonly
Returns the value of attribute attribute_name.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#el ⇒ Object
readonly
Returns the value of attribute el.
-
#is_cpp ⇒ Object
readonly
Returns the value of attribute is_cpp.
Instance Method Summary collapse
-
#initialize(el, parent, key, value) ⇒ EventListener
constructor
A new instance of EventListener.
Constructor Details
#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 |
Instance Attribute Details
#attribute_name ⇒ Object (readonly)
Returns the value of attribute attribute_name.
5 6 7 |
# File 'lib/comet-html/parser-binding.rb', line 5 def attribute_name @attribute_name end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
5 6 7 |
# File 'lib/comet-html/parser-binding.rb', line 5 def code @code end |
#el ⇒ Object (readonly)
Returns the value of attribute el.
5 6 7 |
# File 'lib/comet-html/parser-binding.rb', line 5 def el @el end |
#is_cpp ⇒ Object (readonly)
Returns the value of attribute is_cpp.
5 6 7 |
# File 'lib/comet-html/parser-binding.rb', line 5 def is_cpp @is_cpp end |