Class: LastfmM3u::Lastfm
Instance Attribute Summary collapse
-
#artist ⇒ Object
Returns the value of attribute artist.
-
#limit ⇒ Object
Returns the value of attribute limit.
-
#root_dir ⇒ Object
Returns the value of attribute root_dir.
-
#tracks ⇒ Object
Returns the value of attribute tracks.
Attributes inherited from Base
Instance Method Summary collapse
- #find_tracks(search_type = @search_type, progressbar = false) ⇒ Object
-
#initialize(artist, options = OpenStruct.new) ⇒ Lastfm
constructor
A new instance of Lastfm.
- #set_artist(artist) ⇒ Object
- #set_top_tracks ⇒ Object
Constructor Details
#initialize(artist, options = OpenStruct.new) ⇒ Lastfm
Returns a new instance of Lastfm.
8 9 10 11 12 13 14 15 16 |
# File 'lib/lastfm-m3u/lastfm.rb', line 8 def initialize(artist, =OpenStruct.new) init_config set_artist(artist) set_top_tracks @root_dir = .directory @limit = .limit @search_type = .type || :file super() end |
Instance Attribute Details
#artist ⇒ Object
Returns the value of attribute artist.
6 7 8 |
# File 'lib/lastfm-m3u/lastfm.rb', line 6 def artist @artist end |
#limit ⇒ Object
Returns the value of attribute limit.
6 7 8 |
# File 'lib/lastfm-m3u/lastfm.rb', line 6 def limit @limit end |
#root_dir ⇒ Object
Returns the value of attribute root_dir.
6 7 8 |
# File 'lib/lastfm-m3u/lastfm.rb', line 6 def root_dir @root_dir end |
#tracks ⇒ Object
Returns the value of attribute tracks.
6 7 8 |
# File 'lib/lastfm-m3u/lastfm.rb', line 6 def tracks @tracks end |
Instance Method Details
#find_tracks(search_type = @search_type, progressbar = false) ⇒ Object
26 27 28 29 |
# File 'lib/lastfm-m3u/lastfm.rb', line 26 def find_tracks(search_type=@search_type, =false) check_for_invalid_search_type(search_type) found_tracks(tracks, search_type, ) end |
#set_artist(artist) ⇒ Object
18 19 20 |
# File 'lib/lastfm-m3u/lastfm.rb', line 18 def set_artist(artist) @artist = Rockstar::Artist.new(artist) end |
#set_top_tracks ⇒ Object
22 23 24 |
# File 'lib/lastfm-m3u/lastfm.rb', line 22 def set_top_tracks @tracks = @artist.top_tracks end |