Class: Comet::Binding
- Inherits:
-
Object
- Object
- Comet::Binding
- Defined in:
- lib/comet-html/parser-binding.rb
Instance Attribute Summary collapse
-
#attribute_name ⇒ Object
readonly
Returns the value of attribute attribute_name.
-
#bind_mode ⇒ Object
readonly
Returns the value of attribute bind_mode.
-
#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
- #binds_to_cpp_property? ⇒ Boolean
-
#initialize(el, parent, key, value) ⇒ Binding
constructor
A new instance of Binding.
Constructor Details
#initialize(el, parent, key, value) ⇒ Binding
Returns a new instance of Binding.
24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/comet-html/parser-binding.rb', line 24 def initialize el, parent, key, value @el = el @parent = parent @attribute_name = key.delete_suffix(".bind") @is_cpp = attribute_name.start_with?("cpp::") @attribute_name = attribute_name[5..-1] if is_cpp @code, @bind_mode = extract_bind_mode_from 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.
22 23 24 |
# File 'lib/comet-html/parser-binding.rb', line 22 def attribute_name @attribute_name end |
#bind_mode ⇒ Object (readonly)
Returns the value of attribute bind_mode.
22 23 24 |
# File 'lib/comet-html/parser-binding.rb', line 22 def bind_mode @bind_mode end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
22 23 24 |
# File 'lib/comet-html/parser-binding.rb', line 22 def code @code end |
#el ⇒ Object (readonly)
Returns the value of attribute el.
22 23 24 |
# File 'lib/comet-html/parser-binding.rb', line 22 def el @el end |
#is_cpp ⇒ Object (readonly)
Returns the value of attribute is_cpp.
22 23 24 |
# File 'lib/comet-html/parser-binding.rb', line 22 def is_cpp @is_cpp end |
Instance Method Details
#binds_to_cpp_property? ⇒ Boolean
38 39 40 |
# File 'lib/comet-html/parser-binding.rb', line 38 def binds_to_cpp_property? @is_cpp end |