Class: Lyricli::Sources::Arguments

Inherits:
Object
  • Object
show all
Defined in:
lib/lyricli/sources/arguments.rb

Overview

The arguments source. This one is special since it expects two arguments. It is treated specially by the SourceManager.

Class Attribute Summary (collapse)

Class Method Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Arguments) initialize

Instantiates everything it needs to run.



20
21
22
# File 'lib/lyricli/sources/arguments.rb', line 20

def initialize
  # Nothing to do.
end

Class Attribute Details

+ (Object) name

Returns the value of attribute name



8
9
10
# File 'lib/lyricli/sources/arguments.rb', line 8

def name
  @name
end

Class Method Details

+ (Object) enable

The enable method should run all of the tasks needed to validate the source. In the case of Rdio it has to authenticate with OAuth.



15
16
17
# File 'lib/lyricli/sources/arguments.rb', line 15

def self.enable
  # Nothing to do.
end

+ (Object) reset

The reset method resets any configurations it may have



34
35
36
# File 'lib/lyricli/sources/arguments.rb', line 34

def self.reset
  # Reset Code
end

Instance Method Details

- (Hash) current_track

The current_track method should return the name of the current artist and song.

Returns:

  • (Hash)

    A hash containing the current `:song` and `:artist`.



27
28
29
30
31
# File 'lib/lyricli/sources/arguments.rb', line 27

def current_track
  artist = ARGV[0]
  song = ARGV[1]
  {artist: artist, song: song}
end