Class: XML::Feed::Parser::Tag

Inherits:
Object
  • Object
show all
Defined in:
lib/xml/libxml/feed/parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, data, properties) ⇒ Tag

Returns a new instance of Tag.



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/xml/libxml/feed/parser.rb', line 19

def initialize(name, data, properties)
    if properties
        @property = properties.to_h.dup 
    else
        @property = { }
    end

    if data
        @data = data
    else
        @data = ""
    end

    @name = name.dup
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



17
18
19
# File 'lib/xml/libxml/feed/parser.rb', line 17

def data
  @data
end

#propertyObject (readonly)

Returns the value of attribute property.



16
17
18
# File 'lib/xml/libxml/feed/parser.rb', line 16

def property
  @property
end

Instance Method Details

#to_sObject Also known as: to_str



35
36
37
# File 'lib/xml/libxml/feed/parser.rb', line 35

def to_s
    @data.to_s
end