Class: Clienteer::Ingester::YAMLFile

Inherits:
Object
  • Object
show all
Defined in:
lib/clienteer/ingesters/yaml_file.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeYAMLFile

Returns a new instance of YAMLFile.



10
11
12
13
# File 'lib/clienteer/ingesters/yaml_file.rb', line 10

def initialize
  @clients = YAMLFile.get_clients
  $progressbar = ProgressBar.create total: @clients.length, format: '%a %bᗧ%i %p%% %t', progress_mark: ' ', remainder_mark: ''
end

Class Method Details

.get_clientsObject



6
7
8
# File 'lib/clienteer/ingesters/yaml_file.rb', line 6

def self.get_clients
  YAML.load_file("data/mindbody.yml")
end

Instance Method Details

#eachObject



15
16
17
18
19
20
21
# File 'lib/clienteer/ingesters/yaml_file.rb', line 15

def each
  @clients.each do |c|
    $progressbar.increment
    object = {raw: c}
    yield object
  end
end