Module: NPR

Defined in:
lib/rubynpr/item.rb,
lib/rubynpr/list.rb,
lib/rubynpr/show.rb,
lib/rubynpr/audio.rb,
lib/rubynpr/image.rb,
lib/rubynpr/story.rb,
lib/rubynpr/byline.rb,
lib/rubynpr/parent.rb,
lib/rubynpr/content.rb,
lib/rubynpr/message.rb,
lib/rubynpr/product.rb,
lib/rubynpr/exception.rb,
lib/rubynpr/pull_quote.rb,
lib/rubynpr/subcategory.rb,
lib/rubynpr/organization.rb,
lib/rubynpr/related_link.rb,
lib/rubynpr/result_parser.rb

Defined Under Namespace

Classes: Audio, Byline, Content, DeactivatedAPIKey, Image, InvalidAPIKey, InvalidList, InvalidQueryOptions, Item, Message, NPRException, NPRSystemIssues, Organization, Parent, Product, PullQuote, RelatedLink, ResultParser, Show, Story, StoryList, Subcategory, TopicList, Warning

Constant Summary collapse

RESULT_DATE_FORMAT =
"%a, %d %b %Y %H:%M:%S %z"

Class Method Summary collapse

Class Method Details

.process_elements(element, nprml) ⇒ Object

I REALLY want to move this into Content.



39
40
41
42
43
44
45
46
# File 'lib/rubynpr/list.rb', line 39

def self.process_elements(element, nprml)
  return nil if !['story', 'item', 'subcategory'].include?(element)
  list = []
  nprml.search(element).each do |e|
    list << NPR.const_get(element.capitalize).new(e)
  end
  list
end