Sha256: 6d30906400fcf9c895149197e6140b107abf4f292681bfcf9ffdb79440c1b338

Contents?: true

Size: 847 Bytes

Versions: 2

Compression:

Stored size: 847 Bytes

Contents

module Zelda
  class Zender < Zelda::Base
    class << self
      # Find a Zender by code, such as +NL1+ or +101+.
      def find(code)
        response = Request.get("zenders/#{code}")
        response ? new(response['zender']) : nil
      end
      
      # Find all Zenders.
      def all
        Request.get("zenders")['zenders']
      end
    end
    
    def to_s
      name
    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

2 entries across 2 versions & 1 rubygems

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