Class: Tagomatic::TagSetter

Inherits:
Object
  • Object
show all
Defined in:
lib/tagomatic/tag_setter.rb

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ TagSetter

Returns a new instance of TagSetter.



5
6
7
# File 'lib/tagomatic/tag_setter.rb', line 5

def initialize(options)
  @options = options
end

Instance Method Details

#process(tags_hash) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/tagomatic/tag_setter.rb', line 9

def process(tags_hash)
  tags_hash[:a] if @options[:artist]
  tags_hash[:b] if @options[:album]
  tags_hash[:d] if @options[:discnum]
  tags_hash[:g] if @options[:genre]
  tags_hash[:n] if @options[:tracknum]
  tags_hash[:t] if @options[:title]
  tags_hash[:y] if @options[:year]
  tags_hash
end