Class: Siilar::Struct::Radio

Inherits:
Base
  • Object
show all
Defined in:
lib/siilar/struct/radio.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Siilar::Struct::Base

Instance Attribute Details

#idObject

Returns the value of attribute id.



5
6
7
# File 'lib/siilar/struct/radio.rb', line 5

def id
  @id
end

Instance Method Details

#current_tracksObject



6
7
8
# File 'lib/siilar/struct/radio.rb', line 6

def current_tracks 
  @current_tracks ||= []
end

#current_tracks=(attrs) ⇒ Object



10
11
12
13
14
# File 'lib/siilar/struct/radio.rb', line 10

def current_tracks=(attrs)
  if attrs
    @current_tracks = attrs.map { |track| Struct::Track.new(track) }
  end
end

#seedsObject



16
17
18
# File 'lib/siilar/struct/radio.rb', line 16

def seeds
  @seeds ||= []
end

#seeds=(attrs) ⇒ Object



20
21
22
23
24
# File 'lib/siilar/struct/radio.rb', line 20

def seeds=(attrs)
  if attrs
    @seeds = attrs.map { |seed| Struct::Track.new(seed) }
  end
end

#tagsObject



26
27
28
# File 'lib/siilar/struct/radio.rb', line 26

def tags 
  @tags ||= []
end

#tags=(attrs) ⇒ Object



30
31
32
33
34
# File 'lib/siilar/struct/radio.rb', line 30

def tags=(attrs)
  if attrs
    @tags = attrs.map { |tag| Struct::Tag.new(tag) }
  end
end

#userObject



36
37
38
# File 'lib/siilar/struct/radio.rb', line 36

def user
  @tags ||= {}
end

#user=(attrs) ⇒ Object



40
41
42
43
44
# File 'lib/siilar/struct/radio.rb', line 40

def user=(attrs)
  if attrs
    @user = Struct::User.new(attrs)
  end
end