Class: Shoutcast::Station

Inherits:
Object
  • Object
show all
Includes:
Xml
Defined in:
lib/shoutcast_api.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Xml

included

Instance Attribute Details

#tuneinObject

<station

id="423873"
name="www.deathmetal.at"
mt="audio/mpeg"
br="128"
genre="METAL"
ct="TITLE"
lc="24"/>


73
74
75
# File 'lib/shoutcast_api.rb', line 73

def tunein
  @tunein
end

Class Method Details

.headerObject



91
92
93
# File 'lib/shoutcast_api.rb', line 91

def self.header
  "%11s %3s %-40s %7s %50s" % %w(id bit station-name listen. title)
end

Instance Method Details

#<=>(other) ⇒ Object



95
96
97
98
99
# File 'lib/shoutcast_api.rb', line 95

def <=>(other)
  result = listeners <=> other.listeners
  result = id <=> other.id  if result.zero?
  result
end

#to_sObject



87
88
89
# File 'lib/shoutcast_api.rb', line 87

def to_s
  "#%10d %3d %40s %7d %50s" % [ id, bitrate, name[0...40], listeners, current_title[0...50] ]
end

#typeObject



83
84
85
# File 'lib/shoutcast_api.rb', line 83

def type
  media_type.split('/').last || media_type
end