Class: Tumblr::Data::Regular
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#title ⇒ Object
Returns the value of attribute title.
Attributes inherited from Post
#bookmarklet, #date, #postid, #url
Instance Method Summary collapse
-
#initialize(elt, tz) ⇒ Regular
constructor
A new instance of Regular.
- #to_xml ⇒ Object
Constructor Details
#initialize(elt, tz) ⇒ Regular
Returns a new instance of Regular.
117 118 119 120 121 122 123 124 125 |
# File 'lib/tumblr.rb', line 117 def initialize(elt, tz) super if elt.elements["regular-title"] @title = elt.elements["regular-title"].text end if elt.elements["regular-body"] @body = elt.elements["regular-body"].text end end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
115 116 117 |
# File 'lib/tumblr.rb', line 115 def body @body end |
#title ⇒ Object
Returns the value of attribute title.
115 116 117 |
# File 'lib/tumblr.rb', line 115 def title @title end |
Instance Method Details
#to_xml ⇒ Object
127 128 129 130 131 132 133 134 135 136 137 |
# File 'lib/tumblr.rb', line 127 def to_xml elt = super elt.attributes["type"] = "regular" if @title (elt.add_element("regular-title")).text = @title end if @body (elt.add_element("regular-body")).text = @body end return elt end |