class VAST::NonLinearCreative

NonLinearCreative runs concurrently with the video content so the users see the ad while viewing the content. Non-linear video ads can be delivered as text, graphical ads, or as video overlays.

Public Instance Methods

api_framework() click to toggle source

Defines the method to use for communication with the companion

# File lib/vast/non_linear_creative.rb, line 31
def api_framework
  source_node[:apiFramework]
end
click_through_url() click to toggle source

URI to open as destination page when user clicks on creative

# File lib/vast/non_linear_creative.rb, line 36
def click_through_url
  URI.parse source_node.at('NonLinearClickThrough').content.strip
end
click_tracking_url() click to toggle source
# File lib/vast/non_linear_creative.rb, line 40
def click_tracking_url
  URI.parse source_node.at('NonLinearClickTracking').content.strip
end
creative_type() click to toggle source

Returns MIME type of static creative

# File lib/vast/non_linear_creative.rb, line 73
def creative_type
  if resource_type == :static
    source_node.at('StaticResource')[:creativeType]
  end
end
expanded_height() click to toggle source

Height in pixels when in expanded state

# File lib/vast/non_linear_creative.rb, line 26
def expanded_height
  source_node[:expandedHeight].to_i
end
expanded_width() click to toggle source

Width in pixels when in expanded state

# File lib/vast/non_linear_creative.rb, line 21
def expanded_width
  source_node[:expandedWidth].to_i
end
height() click to toggle source

Height in pixels

# File lib/vast/non_linear_creative.rb, line 16
def height
  source_node[:height].to_i
end
id() click to toggle source
# File lib/vast/non_linear_creative.rb, line 6
def id
  source_node[:id]
end
maintain_aspect_ratio?() click to toggle source

Whether the mediafile must have its aspect ratio maintained when scaled

# File lib/vast/non_linear_creative.rb, line 50
def maintain_aspect_ratio?
  source_node[:maintainAspectRatio]=="true"
end
min_suggested_duration() click to toggle source

Suggested duration to display non-linear ad, typically for animation to complete. Expressed in standard time format hh:mm:ss

# File lib/vast/non_linear_creative.rb, line 56
def min_suggested_duration
  source_node[:minSuggestedDuration]
end
resource_html() click to toggle source

Returns HTML text for html resource

# File lib/vast/non_linear_creative.rb, line 90
def resource_html
  if resource_type == :html
    source_node.at('HTMLResource').content
  end
end
resource_type() click to toggle source

Type of non-linear resource, returned as a symbol. Either :static, :iframe, or :html.

# File lib/vast/non_linear_creative.rb, line 62
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/non_linear_creative.rb, line 80
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
scalable?() click to toggle source

Whether it is acceptable to scale the mediafile.

# File lib/vast/non_linear_creative.rb, line 45
def scalable?
  source_node[:scalable]=="true"
end
width() click to toggle source

Width in pixels

# File lib/vast/non_linear_creative.rb, line 11
def width
  source_node[:width].to_i
end