Class: NPR::Content

Inherits:
Object
  • Object
show all
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.

Instance Method Summary collapse

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