Class: Dryml::Parser::Element

Inherits:
REXML::Element
  • Object
show all
Defined in:
lib/dryml/parser/element.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Element

Returns a new instance of Element.



5
6
7
8
# File 'lib/dryml/parser/element.rb', line 5

def initialize(*args)
  super
  @elements = Dryml::Parser::Elements.new(self)
end

Instance Attribute Details

#has_end_tag=(value) ⇒ Object (writeonly)

Sets the attribute has_end_tag

Parameters:

  • value

    the value to set the attribute has_end_tag to.



16
17
18
# File 'lib/dryml/parser/element.rb', line 16

def has_end_tag=(value)
  @has_end_tag = value
end

#source_offsetObject

Returns the value of attribute source_offset.



14
15
16
# File 'lib/dryml/parser/element.rb', line 14

def source_offset
  @source_offset
end

#start_tag_sourceObject

Returns the value of attribute start_tag_source.



14
15
16
# File 'lib/dryml/parser/element.rb', line 14

def start_tag_source
  @start_tag_source
end

Instance Method Details

#dryml_nameObject



10
11
12
# File 'lib/dryml/parser/element.rb', line 10

def dryml_name
  expanded_name.sub(/:.*/, "")
end

#has_end_tag?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/dryml/parser/element.rb', line 17

def has_end_tag?
  @has_end_tag
end

#parameter_tag?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/dryml/parser/element.rb', line 21

def parameter_tag?
  expanded_name =~ /:$/
end