Class: Clienteer::Ingester::Mindbody
- Inherits:
-
Object
- Object
- Clienteer::Ingester::Mindbody
- Defined in:
- lib/clienteer/ingesters/mindbody.rb
Class Method Summary collapse
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize ⇒ Mindbody
constructor
A new instance of Mindbody.
Constructor Details
#initialize ⇒ Mindbody
Returns a new instance of Mindbody.
18 19 20 21 |
# File 'lib/clienteer/ingesters/mindbody.rb', line 18 def initialize $progressbar = ProgressBar.create total: 2059, format: '%a %bᗧ%i %p%% %t', progress_mark: ' ', remainder_mark: '・' @clients = Mindbody.get_clients end |
Class Method Details
.get_clients ⇒ Object
6 7 8 9 10 |
# File 'lib/clienteer/ingesters/mindbody.rb', line 6 def self.get_clients hash = {"Username" => ENV["MINDBODY_USERNAME"], "Password" => ENV["MINDBODY_PASSWORD"], "SiteIDs" => {"int" => ENV["MINDBODY_SITE_IDS"]}} alpha = ::MindBody::Services::ClientService.get_clients("UserCredentials" => hash, "SearchText" => "") alpha.result[:clients] end |
.to_file ⇒ Object
12 13 14 15 16 |
# File 'lib/clienteer/ingesters/mindbody.rb', line 12 def self.to_file File.open('data/mindbody.yml', 'w') do |file| file.write(YAML.dump(Mindbody.get_clients)) end end |
Instance Method Details
#each ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/clienteer/ingesters/mindbody.rb', line 23 def each @clients.each do |c| $progressbar.increment object = {raw: c} yield object end end |