Class: EncodingDotCom::Thumbnail
- Inherits:
-
Object
- Object
- EncodingDotCom::Thumbnail
- Defined in:
- lib/encoding_dot_com/thumbnail.rb
Instance Method Summary collapse
-
#initialize(time, destination_url, options = {}) ⇒ Thumbnail
constructor
A new instance of Thumbnail.
- #to_xml(options = {}) ⇒ Object
Constructor Details
#initialize(time, destination_url, options = {}) ⇒ Thumbnail
Returns a new instance of Thumbnail.
3 4 5 6 7 |
# File 'lib/encoding_dot_com/thumbnail.rb', line 3 def initialize(time, destination_url, = {}) @time = time @destination = Media.media_url_string(URI.parse(destination_url.to_s)) @options = end |
Instance Method Details
#to_xml(options = {}) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/encoding_dot_com/thumbnail.rb', line 9 def to_xml( = {}) xml = [:builder] ||= ::Builder::XmlMarkup.new(:indent => [:indent] ||= 2) xml.format do xml.output('thumbnail') xml.time(@time) xml.width(@options[:width]) if @options[:width] xml.height(@options[:height]) if @options[:height] xml.destination(@destination) unless @destination.nil? end end |