Sha256: 82f9134128f02ccafa0f08a72e05271669c0e1342d7924b219991de62f52bdb9

Contents?: true

Size: 376 Bytes

Versions: 15

Compression:

Stored size: 376 Bytes

Contents

module AppleNews
  module Links
    extend ActiveSupport::Concern

    included do
      def link(name)
        URI::parse(@links[name]).path
      end

      def section_link_id(name)
        link(name).match(/\/sections\/([A-Za-z0-9\-]+)/)[1]
      end

      def channel_link_id(name)
        link(name).match(/\/channels\/([A-Za-z0-9\-]+)/)[1]
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
apple-news-0.5.1 lib/apple-news/links.rb
apple-news-0.5.0 lib/apple-news/links.rb
apple-news-0.4.2 lib/apple-news/links.rb
apple-news-0.4.1 lib/apple-news/links.rb
apple-news-0.4.0 lib/apple-news/links.rb
apple-news-0.3.1 lib/apple-news/links.rb
apple-news-0.3.0 lib/apple-news/links.rb
apple-news-0.2.5 lib/apple-news/links.rb
apple-news-0.2.4 lib/apple-news/links.rb
apple-news-0.2.3 lib/apple-news/links.rb
apple-news-0.2.2 lib/apple-news/links.rb
apple-news-0.2.1 lib/apple-news/links.rb
apple-news-0.2.0 lib/apple-news/links.rb
apple-news-0.1.1 lib/apple-news/links.rb
apple-news-0.1.0 lib/apple-news/links.rb