Class: Tumblr::Data::Quote
Instance Attribute Summary collapse
-
#source ⇒ Object
Returns the value of attribute source.
-
#text ⇒ Object
Returns the value of attribute text.
Attributes inherited from Post
#bookmarklet, #date, #postid, #url
Instance Method Summary collapse
-
#initialize(elt, tz) ⇒ Quote
constructor
A new instance of Quote.
- #to_xml ⇒ Object
Constructor Details
#initialize(elt, tz) ⇒ Quote
Returns a new instance of Quote.
143 144 145 146 147 148 149 |
# File 'lib/tumblr.rb', line 143 def initialize(elt, tz) super @text = elt.elements["quote-text"].text if elt.elements["quote-source"] @source = elt.elements["quote-source"].text end end |
Instance Attribute Details
#source ⇒ Object
Returns the value of attribute source.
141 142 143 |
# File 'lib/tumblr.rb', line 141 def source @source end |
#text ⇒ Object
Returns the value of attribute text.
141 142 143 |
# File 'lib/tumblr.rb', line 141 def text @text end |
Instance Method Details
#to_xml ⇒ Object
151 152 153 154 155 156 157 158 159 160 |
# File 'lib/tumblr.rb', line 151 def to_xml elt = super elt.attributes["type"] = "quote" et = elt.add_element("quote-text") et.text = @text if @source (elt.add_element("quote-source")).text = @source end return elt end |