Class: Comet::CppReference
- Inherits:
-
ReferenceBase
- Object
- ReferenceBase
- Comet::CppReference
- Defined in:
- lib/comet-html/parser-reference.rb
Instance Attribute Summary collapse
-
#default_value ⇒ Object
readonly
Returns the value of attribute default_value.
-
#el ⇒ Object
readonly
Returns the value of attribute el.
-
#initializer(root_getter) ⇒ Object
Returns the value of attribute initializer.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#setter_enabled ⇒ Object
Returns the value of attribute setter_enabled.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #has_default_value? ⇒ Boolean
- #has_getter? ⇒ Boolean
- #has_initializer? ⇒ Boolean
- #has_setter? ⇒ Boolean
-
#initialize(el, type, name, default_value = nil) ⇒ CppReference
constructor
A new instance of CppReference.
- #is_explicit? ⇒ Boolean
- #is_implicit ⇒ Object
Constructor Details
#initialize(el, type, name, default_value = nil) ⇒ CppReference
Returns a new instance of CppReference.
24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/comet-html/parser-reference.rb', line 24 def initialize el, type, name, default_value = nil @el = el @type = type @name = name @default_value = default_value @setter_enabled = true if type.nil? || name.nil? raise ParseError.new(el, "incomplete attribute definition") end unless is_valid_cpp_variable_name?(@name) raise ParseError.new(el, "attribute name `#{@name}` is not a valid C++ variable name") end end |
Instance Attribute Details
#default_value ⇒ Object (readonly)
Returns the value of attribute default_value.
21 22 23 |
# File 'lib/comet-html/parser-reference.rb', line 21 def default_value @default_value end |
#el ⇒ Object (readonly)
Returns the value of attribute el.
21 22 23 |
# File 'lib/comet-html/parser-reference.rb', line 21 def el @el end |
#initializer(root_getter) ⇒ Object
Returns the value of attribute initializer.
22 23 24 |
# File 'lib/comet-html/parser-reference.rb', line 22 def initializer @initializer end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
21 22 23 |
# File 'lib/comet-html/parser-reference.rb', line 21 def name @name end |
#setter_enabled ⇒ Object
Returns the value of attribute setter_enabled.
22 23 24 |
# File 'lib/comet-html/parser-reference.rb', line 22 def setter_enabled @setter_enabled end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
21 22 23 |
# File 'lib/comet-html/parser-reference.rb', line 21 def type @type end |
Instance Method Details
#has_default_value? ⇒ Boolean
40 |
# File 'lib/comet-html/parser-reference.rb', line 40 def has_default_value? ; !default_value.nil? ; end |
#has_getter? ⇒ Boolean
42 |
# File 'lib/comet-html/parser-reference.rb', line 42 def has_getter? ; true ; end |
#has_initializer? ⇒ Boolean
41 |
# File 'lib/comet-html/parser-reference.rb', line 41 def has_initializer? ; !@initializer.nil? end |
#has_setter? ⇒ Boolean
43 |
# File 'lib/comet-html/parser-reference.rb', line 43 def has_setter? ; @setter_enabled ; end |
#is_explicit? ⇒ Boolean
38 |
# File 'lib/comet-html/parser-reference.rb', line 38 def is_explicit? ; true ; end |
#is_implicit ⇒ Object
39 |
# File 'lib/comet-html/parser-reference.rb', line 39 def is_implicit ; false ; end |