Sha256: 3c725aa9b7e4dc063875d98b66a07579001ff9163e0166283138fdac681b4fc6

Contents?: true

Size: 863 Bytes

Versions: 2

Compression:

Stored size: 863 Bytes

Contents

module Zelda
  class Omroep < Zelda::Base
    class << self
      # Find an omroep by slug, such as +kro+.
      def find(slug)
        response = Request.get("omroepen/#{slug}")
        response ? new(response['omroep']) : nil
      end
      
      # Find all omroepen.
      def all
        Request.get("omroepen")['omroepen']
      end
    end
    
    def to_s
      name
    end
    
    # Return all Series for this Omroep.
    def series
      Zelda::Request.get("omroepen/#{slug}/series")['omroep']['series']['serie'].map do |attrs|
        Zelda::Serie.new(attrs)
      end
    end
    
    # Return Series for this Omroep that have broadcasts in the future.
    def current_series
      Zelda::Request.get("omroepen/#{slug}/current_series")['omroep']['current_series']['serie'].map do |attrs|
        Zelda::Serie.new(attrs)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
zelda-1.4.0 lib/zelda/omroep.rb
zelda-1.3.0 lib/zelda/omroep.rb