Class: ItunesController::SourceKind
- Inherits:
-
Object
- Object
- ItunesController::SourceKind
- Defined in:
- lib/itunesController/kinds.rb
Overview
Enum of source kinds
Constant Summary collapse
- AudioCD =
The Audio CD Source Kind
SourceKind.new(1799439172,"Audio CD")
- Device =
The Device Source Kind
SourceKind.new(1799644534,"Device")
- IPod =
The iPod Source Kind
SourceKind.new(1800433508,"iPod")
- Library =
The Library Source Kind
SourceKind.new(1800169826,"Library")
- MP3CD =
The MP3 CD Source Kind
SourceKind.new(1800225604,"MP3 CD")
- RadioTuner =
The Radio Tuner Source Kind
SourceKind.new(1800697198,"Radio Tuner")
SourceKind.new(1800628324,"Shared Library")
- Unknown =
The Unknown Source Kind
SourceKind.new(1800760938,"Unknown")
- @@values =
[AudioCD,Device,IPod,Library,MP3CD,RadioTuner,SharedLibrary,Unknown]
Instance Attribute Summary collapse
-
#displayName ⇒ Object
Returns the value of attribute displayName.
-
#kind ⇒ Number
The Source kind ID.
-
#String ⇒ String
the source display name.
Class Method Summary collapse
-
.fromKind(kind) ⇒ ItunesController::SourceKind
A class scoped method used to get the kind associated with the kind ID.
Instance Method Summary collapse
-
#initialize(kind, displayName) ⇒ SourceKind
constructor
The constructor.
-
#to_s ⇒ Object
Used pretty print the kind to a string.
Constructor Details
#initialize(kind, displayName) ⇒ SourceKind
The constructor
96 97 98 99 |
# File 'lib/itunesController/kinds.rb', line 96 def initialize(kind,displayName) @kind = kind @displayName = displayName end |
Instance Attribute Details
#displayName ⇒ Object
Returns the value of attribute displayName.
91 92 93 |
# File 'lib/itunesController/kinds.rb', line 91 def displayName @displayName end |
#kind ⇒ Number
The Source kind ID
89 90 91 |
# File 'lib/itunesController/kinds.rb', line 89 def kind @kind end |
#String ⇒ String
the source display name
89 90 91 |
# File 'lib/itunesController/kinds.rb', line 89 def String @String end |
Class Method Details
.fromKind(kind) ⇒ ItunesController::SourceKind
A class scoped method used to get the kind associated with the kind ID
123 124 125 126 127 128 129 130 |
# File 'lib/itunesController/kinds.rb', line 123 def self.fromKind(kind) @@values.each { | v1 | if (v1.kind==kind) return v1 end } return SourceKind.new(v1,"Unknown") end |
Instance Method Details
#to_s ⇒ Object
Used pretty print the kind to a string
134 135 136 |
# File 'lib/itunesController/kinds.rb', line 134 def to_s return "#{displayName} (#{kind})" end |