Class: Tumblr::Data::Link
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#name ⇒ Object
Returns the value of attribute name.
-
#url ⇒ Object
Returns the value of attribute url.
Attributes inherited from Post
Instance Method Summary collapse
-
#initialize(elt, tz) ⇒ Link
constructor
A new instance of Link.
- #to_xml ⇒ Object
Constructor Details
#initialize(elt, tz) ⇒ Link
Returns a new instance of Link.
194 195 196 197 198 199 |
# File 'lib/tumblr.rb', line 194 def initialize(elt, tz) super @text = elt.elements["link-text"].text if elt.elements["link-text"] @url = elt.elements["link-url"].text @description = elt.elements["link-description"].text if elt.elements["link-description"] end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
192 193 194 |
# File 'lib/tumblr.rb', line 192 def description @description end |
#name ⇒ Object
Returns the value of attribute name.
192 193 194 |
# File 'lib/tumblr.rb', line 192 def name @name end |
#url ⇒ Object
Returns the value of attribute url.
192 193 194 |
# File 'lib/tumblr.rb', line 192 def url @url end |
Instance Method Details
#to_xml ⇒ Object
201 202 203 204 205 206 207 208 209 210 211 |
# File 'lib/tumblr.rb', line 201 def to_xml elt = super elt.attributes["type"] = "link" name = elt.add_element "link-text" name.text = @text url = elt.add_element "link-url" url.text = @url description = elt.add_element "link-description" description.text = @description return elt end |