Module: NPR

Defined in:
lib/npr.rb,
lib/npr/api.rb,
lib/npr/entity.rb,
lib/npr/errors.rb,
lib/npr/concern.rb,
lib/npr/version.rb,
lib/npr/api/client.rb,
lib/npr/entity/mp3.rb,
lib/npr/api/message.rb,
lib/npr/entity/base.rb,
lib/npr/entity/book.rb,
lib/npr/entity/crop.rb,
lib/npr/entity/link.rb,
lib/npr/entity/list.rb,
lib/npr/entity/name.rb,
lib/npr/entity/show.rb,
lib/npr/entity/text.rb,
lib/npr/api/response.rb,
lib/npr/entity/audio.rb,
lib/npr/entity/image.rb,
lib/npr/entity/story.rb,
lib/npr/entity/title.rb,
lib/npr/configuration.rb,
lib/npr/entity/author.rb,
lib/npr/entity/byline.rb,
lib/npr/entity/member.rb,
lib/npr/entity/parent.rb,
lib/npr/entity/stream.rb,
lib/npr/entity/formats.rb,
lib/npr/entity/program.rb,
lib/npr/entity/provider.rb,
lib/npr/concern/relation.rb,
lib/npr/entity/list_text.rb,
lib/npr/entity/paragraph.rb,
lib/npr/entity/promo_art.rb,
lib/npr/api/query_builder.rb,
lib/npr/entity/collection.rb,
lib/npr/entity/intro_text.rb,
lib/npr/entity/pull_quote.rb,
lib/npr/entity/transcript.rb,
lib/npr/entity/enlargement.rb,
lib/npr/entity/permissions.rb,
lib/npr/entity/book_edition.rb,
lib/npr/entity/organization.rb,
lib/npr/entity/related_link.rb,
lib/npr/entity/member_byline.rb,
lib/npr/concern/attr_typecast.rb,
lib/npr/entity/external_asset.rb,
lib/npr/entity/member_promo_art.rb,
lib/npr/concern/links_association.rb,
lib/npr/concern/shallow_attributes.rb,
lib/npr/entity/promo_art_book_edition.rb

Overview

NPR::Entity::PromoArtBookEdition

Defined Under Namespace

Modules: API, Concern, Entity Classes: APIError, ClientError, Configuration, NotConfiguredError, ServerError

Constant Summary collapse

VERSION =
"3.0.0"
Story =

A shorthand so that users of this library can work with just NPR::Story, but allowing us to keep everything organized properly.

NPR::Entity::Story
ATTR_TYPES =

Attributes that are being typecast to Ruby classes

{
  "id"               => :string_to_i,
  "partnerId"        => :string_to_i,
  "storyDate"        => :string_time_parse,
  "pubDate"          => :string_time_parse,
  "lastModifiedDate" => :string_time_parse,
  "showDate"         => :string_time_parse,
  "date"             => :string_time_parse,
  "segNum"           => :string_to_i,
  "num"              => :string_to_i,
  "timestamp"        => :string_time_at,
  "duration"         => :string_to_i
}

Class Method Summary collapse

Class Method Details

.configObject




28
29
30
# File 'lib/npr/configuration.rb', line 28

def self.config
  @config ||= NPR::Configuration.new
end

.configure {|config| ... } ⇒ Object


Pass a block to configure NPR client globally.

Options configured globally will be passed in to every API request. They can still be overridden on a per-query or per-client basis.

Example:

NPR.configure do |config|
  config.apiKey         = "YOUR_API_KEY"
  config.sort           = "date descending"
  config.output         = "NPRML"
  config.requiredAssets = "text"
end

Yields:



22
23
24
# File 'lib/npr/configuration.rb', line 22

def self.configure
  yield config
end