Class: Dryml::Parser::Attribute
- Inherits:
-
REXML::Attribute
- Object
- REXML::Attribute
- Dryml::Parser::Attribute
- Defined in:
- lib/dryml/parser/attribute.rb
Instance Method Summary collapse
-
#element=(element) ⇒ Object
Override to supress Text.check call.
- #has_rhs? ⇒ Boolean
-
#initialize(first, second = nil, parent = nil) ⇒ Attribute
constructor
A new instance of Attribute.
- #to_string ⇒ Object
- #value ⇒ Object
Constructor Details
#initialize(first, second = nil, parent = nil) ⇒ Attribute
Returns a new instance of Attribute.
5 6 7 8 9 10 |
# File 'lib/dryml/parser/attribute.rb', line 5 def initialize(first, second=nil, parent=nil) super if first.is_a?(String) && second == true @value = true end end |
Instance Method Details
#element=(element) ⇒ Object
Override to supress Text.check call
34 35 36 37 |
# File 'lib/dryml/parser/attribute.rb', line 34 def element=( element ) @element = element self end |
#has_rhs? ⇒ Boolean
28 29 30 |
# File 'lib/dryml/parser/attribute.rb', line 28 def has_rhs? !defined?(@value) end |
#to_string ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/dryml/parser/attribute.rb', line 20 def to_string if has_rhs? super else @expanded_name end end |
#value ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/dryml/parser/attribute.rb', line 12 def value if has_rhs? super else element.document.default_attribute_value end end |