Class: Encosion::Playlist
- Inherits:
-
Object
- Object
- Encosion::Playlist
- Defined in:
- lib/encosion/playlist.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#reference_id ⇒ Object
readonly
Returns the value of attribute reference_id.
-
#short_description ⇒ Object
readonly
Returns the value of attribute short_description.
-
#videos ⇒ Object
readonly
Returns the value of attribute videos.
Instance Method Summary collapse
-
#initialize(obj) ⇒ Playlist
constructor
A new instance of Playlist.
- #to_json ⇒ Object
Constructor Details
#initialize(obj) ⇒ Playlist
Returns a new instance of Playlist.
7 8 9 10 11 12 |
# File 'lib/encosion/playlist.rb', line 7 def initialize(obj) @id = obj['id'] @name = obj['name'] @short_description = obj['shortDescription'] @videos = obj['videos'].collect { |video| Video.new(video) } end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/encosion/playlist.rb', line 5 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/encosion/playlist.rb', line 5 def name @name end |
#reference_id ⇒ Object (readonly)
Returns the value of attribute reference_id.
5 6 7 |
# File 'lib/encosion/playlist.rb', line 5 def reference_id @reference_id end |
#short_description ⇒ Object (readonly)
Returns the value of attribute short_description.
5 6 7 |
# File 'lib/encosion/playlist.rb', line 5 def short_description @short_description end |
#videos ⇒ Object (readonly)
Returns the value of attribute videos.
5 6 7 |
# File 'lib/encosion/playlist.rb', line 5 def videos @videos end |
Instance Method Details
#to_json ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/encosion/playlist.rb', line 14 def to_json { :id => @id, :name => @name, :short_description => @short_description, :reference_id => @reference_id, :videos => @videos }.to_json end |