class ACTV::Article

Public Class Methods

valid?(response) click to toggle source
# File lib/actv/article.rb, line 11
def self.valid? response
  ACTV::ArticleValidator.new(response).valid?
end

Public Instance Methods

image() click to toggle source
# File lib/actv/article.rb, line 27
def image
  @image ||= image_by_name 'image2'
end
inline_ad() click to toggle source
# File lib/actv/article.rb, line 43
def inline_ad
  @inline_ad ||= resolve_inline_ad_tag
end
Also aliased as: inline_ad?
inline_ad?()
Alias for: inline_ad
is_article?() click to toggle source
# File lib/actv/article.rb, line 48
def is_article?
  true
end
reference_articles() click to toggle source
# File lib/actv/article.rb, line 52
def reference_articles
  article_references = references.select { |ref| ref.type.downcase == 'reference-article' }
  if article_references.present?
    @reference_articles ||= ACTV.asset(article_references.map(&:id))
  end
end
source() click to toggle source
# File lib/actv/article.rb, line 15
def source
  @source ||= description_by_type 'articleSource'
end
subtitle() click to toggle source
# File lib/actv/article.rb, line 35
def subtitle
  @subtitle ||= description_by_type 'subtitle'
end
thumbnail() click to toggle source
# File lib/actv/article.rb, line 31
def thumbnail
  @thumbnail ||= image_by_name 'small'
end
type() click to toggle source
# File lib/actv/article.rb, line 19
def type
  @type ||= tag_by_description 'articleType'
end

Private Instance Methods

resolve_inline_ad_tag() click to toggle source
# File lib/actv/article.rb, line 61
def resolve_inline_ad_tag
  tag = tag_by_description 'inlinead'
  return false if tag && tag.downcase != 'true'
  true
end