Class: ItunesController::SpecialKind
- Inherits:
-
Object
- Object
- ItunesController::SpecialKind
- Defined in:
- lib/itunesController/kinds.rb
Overview
A enum of special kinds
Constant Summary collapse
- Audiobooks =
The Audio Book kind
SpecialKind.new(1800630337,"Audiobooks")
- Folder =
The folder kind
SpecialKind.new(1800630342,"Folder")
- Movies =
The movie kind
SpecialKind.new(1800630345,"Movies")
- Music =
The music kind
SpecialKind.new(1800630362,"Music")
- None =
The none kind
SpecialKind.new(1800302446,"None")
- PartyShuffle =
The party shuffle kind
SpecialKind.new(1800630355,"Party Shuffle")
- Podcasts =
The pod cast kind
SpecialKind.new(1800630352,"Podcasts")
- PurchasedMusic =
The purchased music kind
SpecialKind.new(1800630349,"Purchased Music")
- TVShows =
The TV show kind
SpecialKind.new(1800630356,"TV Shows")
- Videos =
The video kind
SpecialKind.new(1800630358,"Videos")
- Genius =
The genius kind
SpecialKind.new(1800630343,"Genius")
- ITunesU =
The iTunesU kind
SpecialKind.new(1800630357,"iTunes U")
- Library =
The library kind
SpecialKind.new(1800630348,"Library")
- Unknown =
The unknown kind
SpecialKind.new(-1,"Unknown")
- @@values =
[Audiobooks,Folder,Movies,Music, None,PartyShuffle,Podcasts,PurchasedMusic, TVShows, Videos,Genius,ITunesU,Library,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) ⇒ SpecialKind
constructor
A new instance of SpecialKind.
-
#to_s ⇒ Object
Used pretty print the kind to a string.
Constructor Details
#initialize(kind, displayName) ⇒ SpecialKind
Returns a new instance of SpecialKind.
29 30 31 32 |
# File 'lib/itunesController/kinds.rb', line 29 def initialize(kind,displayName) @kind = kind @displayName = displayName end |
Instance Attribute Details
#displayName ⇒ Object
Returns the value of attribute displayName.
28 29 30 |
# File 'lib/itunesController/kinds.rb', line 28 def displayName @displayName end |
#kind ⇒ Number
The Source kind ID
27 28 29 |
# File 'lib/itunesController/kinds.rb', line 27 def kind @kind end |
#String ⇒ String
the source display name
27 28 29 |
# File 'lib/itunesController/kinds.rb', line 27 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
70 71 72 73 74 75 76 77 |
# File 'lib/itunesController/kinds.rb', line 70 def self.fromKind(kind) @@values.each { | v1 | if (v1.kind==kind) return v1 end } return SpecialKind.new(v1,"Unknown") end |
Instance Method Details
#to_s ⇒ Object
Used pretty print the kind to a string
81 82 83 |
# File 'lib/itunesController/kinds.rb', line 81 def to_s return "#{displayName} (#{kind})" end |