Class: NPR::Product

Inherits:
Content show all
Defined in:
lib/rubynpr/product.rb

Overview

Product represents any products associated with a Story. A lot of stories have books attached as products. Product isn’t officially documented in the NPR API documentation, thus the comments here are based on observations. Products have the following attributes:

  • id - the unique ID for the Product within NPR

  • type - what kind of Product this is, i.e., book, etc

  • author - a book’s author

  • upc - the UPC code for a Product

  • publisher - the publisher of a book

  • year - the year the book or Product was introduced/published

  • link - a hash linking to the product for sale on a vendor’s website. Use link[:uri]

to access the URI for the product and <tt>link[:vendor]</tt> to access the vendor.

Instance Attribute Summary collapse

Method Summary

Methods inherited from Content

#initialize

Constructor Details

This class inherits a constructor from NPR::Content

Instance Attribute Details

#authorObject

Returns the value of attribute author.



17
18
19
# File 'lib/rubynpr/product.rb', line 17

def author
  @author
end

#idObject

Returns the value of attribute id.



17
18
19
# File 'lib/rubynpr/product.rb', line 17

def id
  @id
end

Returns the value of attribute link.



17
18
19
# File 'lib/rubynpr/product.rb', line 17

def link
  @link
end

#publisherObject

Returns the value of attribute publisher.



17
18
19
# File 'lib/rubynpr/product.rb', line 17

def publisher
  @publisher
end

#titleObject

Returns the value of attribute title.



17
18
19
# File 'lib/rubynpr/product.rb', line 17

def title
  @title
end

#typeObject

Returns the value of attribute type.



17
18
19
# File 'lib/rubynpr/product.rb', line 17

def type
  @type
end

#upcObject

Returns the value of attribute upc.



17
18
19
# File 'lib/rubynpr/product.rb', line 17

def upc
  @upc
end

#yearObject

Returns the value of attribute year.



17
18
19
# File 'lib/rubynpr/product.rb', line 17

def year
  @year
end