Class: LastfmPathFinder::Path

Inherits:
Object
  • Object
show all
Includes:
Redis::Objects
Defined in:
lib/lastfm_path_finder/path.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(from, to) ⇒ Path

Returns a new instance of Path.



11
12
13
14
15
# File 'lib/lastfm_path_finder/path.rb', line 11

def initialize from, to
  self.artist_from = from
  self.artist_to = to
  self.id = "#{artist_from.id}_#{artist_to.id}"
end

Instance Attribute Details

#artist_fromObject

Returns the value of attribute artist_from.



6
7
8
# File 'lib/lastfm_path_finder/path.rb', line 6

def artist_from
  @artist_from
end

#artist_toObject

Returns the value of attribute artist_to.



6
7
8
# File 'lib/lastfm_path_finder/path.rb', line 6

def artist_to
  @artist_to
end

#idObject

Returns the value of attribute id.



5
6
7
# File 'lib/lastfm_path_finder/path.rb', line 5

def id
  @id
end

Instance Method Details

#found?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/lastfm_path_finder/path.rb', line 17

def found?
  !artists.values.empty?
end