Class: UpdateTags

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tag_directory, path_to_tag_index_page_template) ⇒ UpdateTags

Returns a new instance of UpdateTags.



11
12
13
14
# File 'lib/update_tags.rb', line 11

def initialize(tag_directory, path_to_tag_index_page_template)
  @tag_directory = tag_directory
  @path_to_tag_index_page_template = path_to_tag_index_page_template
end

Instance Attribute Details

#path_to_tag_index_page_templateObject (readonly)

Returns the value of attribute path_to_tag_index_page_template.



9
10
11
# File 'lib/update_tags.rb', line 9

def path_to_tag_index_page_template
  @path_to_tag_index_page_template
end

#tag_directoryObject (readonly)

Returns the value of attribute tag_directory.



9
10
11
# File 'lib/update_tags.rb', line 9

def tag_directory
  @tag_directory
end

Class Method Details

.update(tag_directory:, path_to_tag_index_page_template:) ⇒ Object



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

def self.update(tag_directory:, path_to_tag_index_page_template:)
  new(tag_directory, path_to_tag_index_page_template).update
end

Instance Method Details

#updateObject



16
17
18
19
20
21
# File 'lib/update_tags.rb', line 16

def update
  print "Updating tags..."
  delete_tag_pages
  create_tag_pages
  print " Done.\n"
end