class VAST::Icon
Any number of Mediafile
objects can be provided for a single Ad
, but it is assumed that all Mediafiles belongs to a single Ad
object represent the same creative unit with the same duration, Ad-ID (ISCI code), etc.
Public Instance Methods
api_framework()
click to toggle source
Defines the method to use for communication with the companion
# File lib/vast/icon.rb, line 35 def api_framework source_node[:apiFramework] end
click_through_url()
click to toggle source
# File lib/vast/icon.rb, line 73 def click_through_url URI.parse source_node.at('IconClickThrough').content.strip end
click_tracking_url()
click to toggle source
# File lib/vast/icon.rb, line 77 def click_tracking_url URI.parse source_node.at('IconClickTracking').content.strip end
creative_type()
click to toggle source
Returns MIME type of static creative
# File lib/vast/icon.rb, line 50 def creative_type if resource_type == :static source_node.at('StaticResource')[:creativeType] end end
duration()
click to toggle source
# File lib/vast/icon.rb, line 26 def duration source_node[:duration].to_i end
height()
click to toggle source
# File lib/vast/icon.rb, line 14 def height source_node[:height].to_i end
offset()
click to toggle source
# File lib/vast/icon.rb, line 30 def offset source_node[:offset].to_i end
program()
click to toggle source
# File lib/vast/icon.rb, line 6 def program source_node[:program] end
resource_html()
click to toggle source
Returns HTML text for html resource
# File lib/vast/icon.rb, line 67 def resource_html if resource_type == :html source_node.at('HTMLResource').content end end
resource_type()
click to toggle source
# File lib/vast/icon.rb, line 39 def resource_type if source_node.at('StaticResource') :static elsif source_node.at('IFrameResource') :iframe elsif source_node.at('HTMLResource') :html end end
resource_url()
click to toggle source
Returns URI for static or iframe resource
# File lib/vast/icon.rb, line 57 def resource_url case resource_type when :static URI.parse source_node.at('StaticResource').content.strip when :iframe URI.parse source_node.at('IFrameResource').content.strip end end
view_tracking_url()
click to toggle source
# File lib/vast/icon.rb, line 81 def view_tracking_url URI.parse source_node.at('IconViewTracking').content.strip end
width()
click to toggle source
# File lib/vast/icon.rb, line 10 def width source_node[:width].to_i end
xPosition()
click to toggle source
# File lib/vast/icon.rb, line 18 def xPosition source_node[:xPosition].to_i end
yPosition()
click to toggle source
# File lib/vast/icon.rb, line 22 def yPosition source_node[:yPosition].to_i end