Class: Tumblr::Data::Video
Instance Attribute Summary
Attributes inherited from Post
#bookmarklet, #date, #postid, #url
Instance Method Summary collapse
-
#initialize(elt, tz) ⇒ Video
constructor
A new instance of Video.
- #to_xml ⇒ Object
Constructor Details
#initialize(elt, tz) ⇒ Video
Returns a new instance of Video.
248 249 250 251 252 253 |
# File 'lib/tumblr.rb', line 248 def initialize(elt, tz) super @caption = elt.elements["video-caption"].text @source = elt.elements["video-source"].text @player = elt.elements["video-player"].text end |
Instance Method Details
#to_xml ⇒ Object
255 256 257 258 259 260 261 262 263 264 265 |
# File 'lib/tumblr.rb', line 255 def to_xml elt = super elt.attributes["type"] = "video" = elt.add_element "video-caption" .text = @caption player = elt.add_element "video-player" player.text = @player source = elt.add_element "video-source" source.text = @source return elt end |