Method: ACTV::Client#article

Defined in:
lib/actv/client.rb

#article(id, params = {}) ⇒ ACTV::Article

Returns an article with the specified ID

Examples:

Return the article with the id BA288960-2718-4B20-B380-8F939596B123

ACTV.article("BA288960-2718-4B20-B380-8F939596B123")

Parameters:

  • id (String)

    An article ID.

  • options (Hash)

    A customizable set of options.

Returns:



147
148
149
150
151
152
153
154
155
156
# File 'lib/actv/client.rb', line 147

def article id, params={}
  request_string = "/v2/assets/#{id}"
  is_preview, params = params_include_preview? params
  request_string += '/preview' if is_preview

  response = get "#{request_string}.json", params

  article = ACTV::Article.new response[:body]
  article.is_article? ? article : nil
end