Class: NPR::RelatedLink

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

Overview

RelatedLink represents any of the links that are included with an NPR story linking to related NPR content. A RelatedLink has its respective caption and two URIs associated with it: one which returns HTML and one which is the API URI for a story.

  • caption - caption for a related link

  • uri - a hash containing URIs to access both the HTML and API representations of a related story. Use options :html or :api.

Example

@related_link = some_story.related_links[0].uri[:api]

Instance Attribute Summary collapse

Method Summary

Methods inherited from Content

#initialize

Constructor Details

This class inherits a constructor from NPR::Content

Instance Attribute Details

#captionObject

Returns the value of attribute caption.



14
15
16
# File 'lib/rubynpr/related_link.rb', line 14

def caption
  @caption
end

#uriObject

Returns the value of attribute uri.



14
15
16
# File 'lib/rubynpr/related_link.rb', line 14

def uri
  @uri
end