mconnect 0.1.3 → 0.1.4

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: 880c1c1ed9b2606985811ed7bcaa304d1fd3b038
4
- data.tar.gz: 5349fed3ae9cb3665e034ee12f31a55833a900c5
3
+ metadata.gz: 5666b5063eecb8e5d60d11ebb056219d781548d2
4
+ data.tar.gz: fca817cb838773da1761a76d74c487cace58ebe0
5
5
  SHA512:
6
- metadata.gz: 0a1a0917dc77b170e4a50f00eae91b94217c693698e93c917eab72a655f4ee07d457d2f58f37776eba7ac1154a904392edae01540248148f6696e70d840f0cee
7
- data.tar.gz: ba7b001e7a412cf5a82016fc363af3eecf8c90c45835f39e2e5a0d6545775c1a6a769a87c3dd3b35d37a873bf503a6d1695d85b81236e4e862fcf61ca278fa44
6
+ metadata.gz: e5d67a48c04593773a761a4d164457584bc13ad1afde001e941f04b55fd0ba7f120adc4a7273a082117b60e04eba3d03f073175964e06bd2c322393a2db40a9f
7
+ data.tar.gz: 293c6960986017bee4392428c8c90d5e12f6caac859a7208cd79f8483d994e406f7a1809a35155d1af5f05ddeb97ab88e5a51e8b0afbde465d2d2e8a00478334
@@ -7,7 +7,7 @@ module Mconnect
7
7
  end
8
8
 
9
9
  def remove_columns columns = []
10
- @content.each do |hash|
10
+ content.each do |hash|
11
11
  hash.reject! do |k,v|
12
12
  columns.include? k
13
13
  end
@@ -15,24 +15,24 @@ module Mconnect
15
15
  end
16
16
 
17
17
  def flatten_column column
18
- orig_content = @content.dup
19
- @content = []
18
+ orig_content = content.dup
19
+ content = []
20
20
 
21
21
  orig_content.each do |hash|
22
- @content << hash[column]
22
+ content << hash[column]
23
23
  end
24
24
 
25
- @content.flatten!
25
+ content.flatten!
26
26
  end
27
27
 
28
28
  def sections_hash
29
- orig_content = @content.dup
30
- @content = []
29
+ orig_content = content.dup
30
+ content = []
31
31
 
32
32
  orig_content.each do |hash|
33
33
  hash['teachers'].each do |t|
34
34
  hash['students'].each do |s|
35
- @content << {
35
+ content << {
36
36
  "id" => hash['id'],
37
37
  "school_id" => hash['school_id'],
38
38
  "name" => hash['name'],
@@ -52,7 +52,7 @@ module Mconnect
52
52
  end
53
53
  end
54
54
 
55
- return @content
55
+ return content
56
56
  end
57
57
  end
58
58
  end
@@ -10,7 +10,7 @@ module Mconnect
10
10
  end
11
11
 
12
12
  def save_csv
13
- decorator = Mconnect::Decorator.new @content
13
+ decorator = Mconnect::Decorator.new content
14
14
 
15
15
  case endpoint
16
16
  when "teachers"
@@ -23,8 +23,8 @@ module Mconnect
23
23
  content = decorator.sections_hash
24
24
  end
25
25
 
26
- CSV.open("#{@directory}/#{@endpoint}.csv", "w", write_headers: true, headers: @content.first.keys) do |csv|
27
- @content.each do |hash|
26
+ CSV.open("#{directory}/#{endpoint}.csv", "w", write_headers: true, headers: content.first.keys) do |csv|
27
+ content.each do |hash|
28
28
  csv << hash.values
29
29
  end
30
30
  end
@@ -1,3 +1,3 @@
1
1
  module Mconnect
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mconnect
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Silas Sao
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-21 00:00:00.000000000 Z
11
+ date: 2014-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -132,4 +132,3 @@ summary: Gem for the MasteryConnect API
132
132
  test_files:
133
133
  - spec/helpers_spec.rb
134
134
  - spec/spec_helper.rb
135
- has_rdoc: