Class: Shoutcast::Station
Instance Attribute Summary collapse
-
#tunein ⇒ Object
<station id=“423873” name=“www.deathmetal.at” mt=“audio/mpeg” br=“128” genre=“METAL” ct=“TITLE” lc=“24”/>.
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Xml
Instance Attribute Details
#tunein ⇒ Object
<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
.header ⇒ Object
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_s ⇒ Object
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 |
#type ⇒ Object
83 84 85 |
# File 'lib/shoutcast_api.rb', line 83 def type media_type.split('/').last || media_type end |