Class: MdlSearch::Updater
- Inherits:
-
Object
- Object
- MdlSearch::Updater
- Defined in:
- lib/mdl_search/updater.rb
Instance Attribute Summary collapse
-
#searcher ⇒ Object
writeonly
Sets the attribute searcher.
Instance Method Summary collapse
- #groups_from_yaml ⇒ Object
-
#initialize ⇒ Updater
constructor
A new instance of Updater.
- #update_groups_yaml ⇒ Object
- #update_icons_yaml ⇒ Object
Constructor Details
#initialize ⇒ Updater
Returns a new instance of Updater.
4 5 6 |
# File 'lib/mdl_search/updater.rb', line 4 def initialize @searcher = Searcher.new end |
Instance Attribute Details
#searcher=(value) ⇒ Object (writeonly)
Sets the attribute searcher
3 4 5 |
# File 'lib/mdl_search/updater.rb', line 3 def searcher=(value) @searcher = value end |
Instance Method Details
#groups_from_yaml ⇒ Object
24 25 26 |
# File 'lib/mdl_search/updater.rb', line 24 def groups_from_yaml YAML.load(File.read(File.('./yaml/groups.yml'))) end |
#update_groups_yaml ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/mdl_search/updater.rb', line 16 def update_groups_yaml file_path = File.('../../../yaml/groups.yml', __FILE__) File.open(file_path, 'w') do |file| file.write @searcher.groups_as_yaml end puts 'complete updating groups yaml file... plz check it.' end |
#update_icons_yaml ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/mdl_search/updater.rb', line 8 def update_icons_yaml file_path = File.('../../../yaml/icons.yml', __FILE__) File.open(file_path, 'w') do |file| file.write @searcher.icons_as_yaml end puts 'complete updating icons yaml file... plz check it.' end |