mconnect 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5666b5063eecb8e5d60d11ebb056219d781548d2
4
- data.tar.gz: fca817cb838773da1761a76d74c487cace58ebe0
3
+ metadata.gz: f6d96350b829a614483b1b1ba7c8559e81cf072b
4
+ data.tar.gz: e6df3d427d882c758d8861159d458476fd8e4826
5
5
  SHA512:
6
- metadata.gz: e5d67a48c04593773a761a4d164457584bc13ad1afde001e941f04b55fd0ba7f120adc4a7273a082117b60e04eba3d03f073175964e06bd2c322393a2db40a9f
7
- data.tar.gz: 293c6960986017bee4392428c8c90d5e12f6caac859a7208cd79f8483d994e406f7a1809a35155d1af5f05ddeb97ab88e5a51e8b0afbde465d2d2e8a00478334
6
+ metadata.gz: 2d4d9ccd718ee438fd237e5769545f86766dd8deb63ae54df6e56d047e5efbaa1095f2880fafc2995a4ac0d6d22ae97e1617327ccd0ed8e165f01a01202c06f1
7
+ data.tar.gz: 7bb2bc7bf54c61486bbbca640745950b5e0604ca29cb6342487c94d5648552e0079c7b874149566bdae116f512bea198fabd0c7f3e9181cbcc2be9dd8f5c4d8a
@@ -5,7 +5,6 @@ module Mconnect
5
5
  include Helpers
6
6
 
7
7
  attr_writer :verifier
8
- attr_reader :client
9
8
 
10
9
  def initialize
11
10
  oauth_options = load_yaml '/tmp/mconnect/config.yml'
@@ -23,11 +22,11 @@ module Mconnect
23
22
 
24
23
  def access_token
25
24
  access_token = load_yaml '/tmp/mconnect/authorization.yml'
26
- OAuth::AccessToken.new(client, access_token.token, access_token.secret)
25
+ OAuth::AccessToken.new(@client, access_token.token, access_token.secret)
27
26
  end
28
27
 
29
28
  def request_token
30
- @request_token ||= client.get_request_token
29
+ @request_token ||= @client.get_request_token
31
30
  end
32
31
 
33
32
  def authorize_url
@@ -1,13 +1,11 @@
1
1
  module Mconnect
2
2
  class Decorator
3
- attr_accessor :content
4
-
5
3
  def initialize content
6
4
  @content = content
7
5
  end
8
6
 
9
7
  def remove_columns columns = []
10
- content.each do |hash|
8
+ @content.each do |hash|
11
9
  hash.reject! do |k,v|
12
10
  columns.include? k
13
11
  end
@@ -15,7 +13,7 @@ module Mconnect
15
13
  end
16
14
 
17
15
  def flatten_column column
18
- orig_content = content.dup
16
+ orig_content = @content.dup
19
17
  content = []
20
18
 
21
19
  orig_content.each do |hash|
@@ -26,7 +24,7 @@ module Mconnect
26
24
  end
27
25
 
28
26
  def sections_hash
29
- orig_content = content.dup
27
+ orig_content = @content.dup
30
28
  content = []
31
29
 
32
30
  orig_content.each do |hash|
@@ -1,8 +1,5 @@
1
1
  module Mconnect
2
2
  class Generator
3
- attr_accessor :content
4
- attr_reader :directory, :endpoint
5
-
6
3
  def initialize content, directory, endpoint
7
4
  @content = content
8
5
  @directory = directory
@@ -10,21 +7,21 @@ module Mconnect
10
7
  end
11
8
 
12
9
  def save_csv
13
- decorator = Mconnect::Decorator.new content
10
+ decorator = Mconnect::Decorator.new @content
14
11
 
15
- case endpoint
12
+ case @endpoint
16
13
  when "teachers"
17
- content = decorator.remove_columns ['custom', 'saml_name']
14
+ @content = decorator.remove_columns ['custom', 'saml_name']
18
15
  when "students"
19
- content = decorator.remove_columns ['sections']
16
+ @content = decorator.remove_columns ['sections']
20
17
  when "standards"
21
- content = decorator.flatten_column 'standards'
18
+ @content = decorator.flatten_column 'standards'
22
19
  when "sections"
23
- content = decorator.sections_hash
20
+ @content = decorator.sections_hash
24
21
  end
25
22
 
26
- CSV.open("#{directory}/#{endpoint}.csv", "w", write_headers: true, headers: content.first.keys) do |csv|
27
- content.each do |hash|
23
+ CSV.open("#{@directory}/#{@endpoint}.csv", "w", write_headers: true, headers: @content.first.keys) do |csv|
24
+ @content.each do |hash|
28
25
  csv << hash.values
29
26
  end
30
27
  end
@@ -1,3 +1,3 @@
1
1
  module Mconnect
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
@@ -1,6 +1,6 @@
1
1
  module Mconnect
2
2
  class Worker
3
- attr_accessor :content
3
+ attr_reader :content
4
4
 
5
5
  def initialize access_token, endpoint
6
6
  @access_token = access_token
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mconnect
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Silas Sao