Sha256: b7afb51f578ba9b4875430b25e8eb7ff355798b6d05e3048396cafed0a629538

Contents?: true

Size: 814 Bytes

Versions: 1

Compression:

Stored size: 814 Bytes

Contents

module Zelda
  class Zender < Zelda::Base
    class << self
      # Find a Zender by code, such as +NL1+ or +101+.
      def find(code)
        attrs = Request.get("zenders/#{code}")['zender'] rescue nil
        attrs ? new(attrs) : nil
      end
      
      # Find all Zenders.
      def all
        Request.get("zenders")['zenders']
      end
    end
    
    # Return all Series for this Zender.
    def series
      Zelda::Request.get("zenders/#{id}/series")['zender']['series']['serie'].map do |attrs|
        Zelda::Serie.new(attrs)
      end
    end

    # Return Series for this Zender that have broadcasts in the future.
    def current_series
      Zelda::Request.get("zenders/#{id}/current_series")['zender']['series']['serie'].map do |attrs|
        Zelda::Serie.new(attrs)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
zelda-1.2.0 lib/zelda/zender.rb