Module: Storify
- Defined in:
- lib/storify/client.rb,
lib/storify.rb,
lib/storify/data.rb,
lib/storify/user.rb,
lib/storify/pager.rb,
lib/storify/story.rb,
lib/storify/agency.rb,
lib/storify/source.rb,
lib/storify/comment.rb,
lib/storify/element.rb,
lib/storify/apierror.rb,
lib/storify/features.rb,
lib/storify/identity.rb,
lib/storify/quotable.rb,
lib/storify/settings.rb,
lib/storify/data/link.rb,
lib/storify/dategroup.rb,
lib/storify/storymeta.rb,
lib/storify/userstats.rb,
lib/storify/coverphoto.rb,
lib/storify/data/image.rb,
lib/storify/data/video.rb,
lib/storify/statsembed.rb,
lib/storify/storystats.rb,
lib/storify/agency/info.rb,
lib/storify/attribution.rb,
lib/storify/createdwith.rb,
lib/storify/data/oembed.rb,
lib/storify/statselement.rb,
lib/storify/settings/fonts.rb,
lib/storify/settings/style.rb,
lib/storify/settings/colors.rb,
lib/storify/settings/options.rb,
lib/storify/settings/typekit.rb,
lib/storify/agency/customerinfo.rb,
lib/storify/settings/notifications.rb,
lib/storify/agency/customerinfokeys.rb
Overview
RestClient.log = ‘./restclient.log’
Defined Under Namespace
Modules: Agency, AttributionRepresentable, CommentRepresentable, CoverPhotoRepresentable, CreatedWithRepresentable, Data, DateGroupRepresentable, ElementRepresentable, FeaturesRepresentable, IdentityRepresentable, QuotableRepresentable, Settings, SourceRepresentable, StatsElementRepresentable, StatsEmbedRepresentable, StoryDataRepresentable, StoryMetaRepresentable, StoryRepresentable, StoryStatsRepresentable, UserAgencyRepresentable, UserRepresentable, UserSettingsRepresentable, UserStatsRepresentable Classes: ApiError, Attribution, Client, Comment, CoverPhoto, CreatedWith, DateGroup, Element, Features, Identity, Pager, Quotable, Source, StatsElement, StatsEmbed, Story, StoryData, StoryMeta, StoryStats, User, UserAgency, UserSettings, UserStats
Constant Summary collapse
- PROTOCOLS =
{ :secure => 'https://', :insecure => 'http://' }
- ENDPOINTS =
{ :v1 => { :base => 'api.storify.com/v1', :auth => '/auth', :stories => '/stories', :userstories => '/stories/:username', :userstory => '/stories/:username/:slug', :latest => '/stories/browse/latest', :featured => '/stories/browse/featured', :popular => '/stories/browse/popular', :topic => '/stories/browse/topic/:topic', :search => '/stories/search', :editslug => '/stories/:username/:slug/editslug', :users => '/users', :userprofile => '/users/:username', :update_profile => '/users/:username/update', :publish => '/stories/:username/:slug/publish' } }
Class Method Summary collapse
- .endpoint(version: :v1, protocol: :secure, method: :base, params: {}) ⇒ Object
- .error(code, message, type, end_of_content: {}) ⇒ Object
Class Method Details
.endpoint(version: :v1, protocol: :secure, method: :base, params: {}) ⇒ Object
32 33 34 35 36 37 38 39 |
# File 'lib/storify.rb', line 32 def self.endpoint(version: :v1, protocol: :secure, method: :base, params: {}) uri = (method == :auth) ? PROTOCOLS[:secure] : PROTOCOLS[protocol] uri += ENDPOINTS[version][:base] uri += ENDPOINTS[version][method] params.each_pair {|k,v| uri = uri.gsub(k,v) } uri end |
.error(code, message, type, end_of_content: {}) ⇒ Object
41 42 43 44 45 46 47 |
# File 'lib/storify.rb', line 41 def self.error(code, , type, end_of_content: {}) unless .downcase.include?('max') raise Storify::ApiError.new(code, , type) end end_of_content end |