Class: DataFetcher

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(batch_id = nil) ⇒ DataFetcher

Returns a new instance of DataFetcher.



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

def initialize(batch_id=nil)
  @batch_id = batch_id
end

Instance Attribute Details

#batch_idObject

Returns the value of attribute batch_id.



3
4
5
# File 'lib/common_tools/data_fetcher.rb', line 3

def batch_id
  @batch_id
end

#clientObject

Returns the value of attribute client.



3
4
5
# File 'lib/common_tools/data_fetcher.rb', line 3

def client
  @client
end

#keysObject

Returns the value of attribute keys.



3
4
5
# File 'lib/common_tools/data_fetcher.rb', line 3

def keys
  @keys
end

Instance Method Details

#get_rosterObject



15
16
17
18
19
# File 'lib/common_tools/data_fetcher.rb', line 15

def get_roster
  configure_keys
  configure_credentials
  @client.csv_for(self.batch_id)
end

#parse_rosterObject



9
10
11
12
# File 'lib/common_tools/data_fetcher.rb', line 9

def parse_roster
  roster = get_roster
  Parser.parse_roster(roster)
end