sched 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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/sched/client.rb +6 -3
- data/lib/sched/event.rb +2 -13
- data/lib/sched/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 674cc175a45b8cd30a9e8869fe8818cfde388aee
|
4
|
+
data.tar.gz: 0f3034b0311764900a03cdfeb55c0547b8ef3b39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90833aee02135e1926c8ca2361ede376f6eca55735eb16528d629fc3bcc7aef8b0cc922921213162c80506822218cbf63be50c660fbd8dd1f7b9b443274c0eb1
|
7
|
+
data.tar.gz: 308b5b8e89d96bdb4b40c3e5f8877afbec19f2ab9f576f566a021d7f826f009e7acabc63ccff14c0fdba51763f1594c489a2173766affc515b97e5902341b073
|
data/Gemfile.lock
CHANGED
data/lib/sched/client.rb
CHANGED
@@ -16,14 +16,17 @@ module Sched
|
|
16
16
|
def events
|
17
17
|
unless @events
|
18
18
|
results = FasterCSV.parse(request('session/list', nil, :get))
|
19
|
-
|
19
|
+
|
20
|
+
attributes = results.shift.map do |a|
|
21
|
+
a.strip.gsub(/[\x80-\xff]/, "").gsub(/^event_/, "session_").to_sym
|
22
|
+
end
|
23
|
+
|
20
24
|
@events = results.map do |row|
|
21
25
|
row_hash = {}
|
22
26
|
attributes.each_with_index do |a, i|
|
23
|
-
a = a.to_s.gsub(/^event_/, "session_").to_sym
|
24
27
|
row_hash[a] = row[i]
|
25
28
|
end
|
26
|
-
|
29
|
+
Sched::Event.new(row_hash[:session_key], self).configure(row_hash)
|
27
30
|
end
|
28
31
|
end
|
29
32
|
@events
|
data/lib/sched/event.rb
CHANGED
@@ -4,12 +4,9 @@ module Sched
|
|
4
4
|
# Required
|
5
5
|
:session_key, :name, :session_start, :session_end, :session_type,
|
6
6
|
# Optional
|
7
|
-
:session_subtype, :description, :panelists, :url, :media_url, :venue,
|
8
|
-
:address, :map, :tags, :active,
|
9
|
-
# WTF
|
10
|
-
:event_key
|
7
|
+
:session_subtype, :description, :panelists, :url, :media_url, :venue, :address, :map, :tags, :active
|
11
8
|
]
|
12
|
-
SCHED_ATTRIBUTES.each
|
9
|
+
SCHED_ATTRIBUTES.each{ |attribute| attr_accessor attribute }
|
13
10
|
attr_accessor :client
|
14
11
|
|
15
12
|
def initialize(session_key, client=nil)
|
@@ -17,14 +14,6 @@ module Sched
|
|
17
14
|
@client = client
|
18
15
|
end
|
19
16
|
|
20
|
-
def event_key
|
21
|
-
session_key
|
22
|
-
end
|
23
|
-
|
24
|
-
def event_key=(new_key)
|
25
|
-
self.session_key = new_key
|
26
|
-
end
|
27
|
-
|
28
17
|
def get_attribute(key)
|
29
18
|
self.send("#{key}")
|
30
19
|
end
|
data/lib/sched/version.rb
CHANGED