Class: NPR::Content
- Inherits:
-
Object
- Object
- NPR::Content
- Defined in:
- lib/rubynpr/content.rb
Overview
Content is the parent of all the content returned from an NPR query. Mainly in place to assist later in dealing with content returned using different formats. The intention is to have it become the starting point (obviously with the presence of initialize) for dealing with NPR results in such a way that if somebody was previously dealing with raw JSON for instance, they could throw it over to this and it would return Ruby objects to work with. ‘tis forthcoming.
Direct Known Subclasses
Audio, Byline, Image, Item, Organization, Parent, Product, PullQuote, RelatedLink, Show, Story, StoryList, Subcategory, TopicList
Instance Method Summary collapse
-
#initialize(markup, format = :nprml) ⇒ Content
constructor
A new instance of Content.
Constructor Details
#initialize(markup, format = :nprml) ⇒ Content
Returns a new instance of Content.
10 11 12 13 14 15 |
# File 'lib/rubynpr/content.rb', line 10 def initialize(markup, format = :nprml) case format when :nprml new_from_nprml(markup) end end |