ur-product 0.9.2 → 0.9.3
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.
- data/lib/ur/product/distribution_event.rb +6 -2
- data/lib/ur/product.rb +14 -0
- metadata +4 -4
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
module UR
|
|
2
2
|
class Product
|
|
3
|
-
class DistributionEvent
|
|
3
|
+
class DistributionEvent
|
|
4
4
|
attr_reader :start_date, :end_date, :platform,
|
|
5
5
|
:event_type, :receiving_agent_group
|
|
6
6
|
|
|
7
7
|
def initialize(data)
|
|
8
8
|
@start_date = Time.parse(data['startdate']) if !data['startdate'].nil?
|
|
9
9
|
@end_date = Time.parse(data['enddate']) if !data['enddate'].nil?
|
|
10
|
-
@receiving_agent_group = data['
|
|
10
|
+
@receiving_agent_group = data['receivingagentgroup']
|
|
11
11
|
@platform = data['platform']
|
|
12
12
|
@event_type = data['type']
|
|
13
13
|
end
|
|
14
|
+
|
|
15
|
+
def active?
|
|
16
|
+
(start_date < Time.now && end_date > Time.now) ? true : false
|
|
17
|
+
end
|
|
14
18
|
end
|
|
15
19
|
end
|
|
16
20
|
end
|
data/lib/ur/product.rb
CHANGED
|
@@ -146,6 +146,20 @@ module UR
|
|
|
146
146
|
end
|
|
147
147
|
end
|
|
148
148
|
|
|
149
|
+
def available_on_avc?
|
|
150
|
+
return @available_on_avc unless @available_on_avc.nil?
|
|
151
|
+
@available_on_avc = false
|
|
152
|
+
|
|
153
|
+
distribution_events.each do |event|
|
|
154
|
+
if event.receiving_agent_group == 'avc'
|
|
155
|
+
@available_on_avc = event.active?
|
|
156
|
+
break
|
|
157
|
+
end
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
@available_on_avc
|
|
161
|
+
end
|
|
162
|
+
|
|
149
163
|
def documents
|
|
150
164
|
return @docs unless @docs.nil?
|
|
151
165
|
@docs = []
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ur-product
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 61
|
|
5
5
|
prerelease: false
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 9
|
|
9
|
-
-
|
|
10
|
-
version: 0.9.
|
|
9
|
+
- 3
|
|
10
|
+
version: 0.9.3
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Peter Hellberg
|
|
@@ -15,7 +15,7 @@ autorequire:
|
|
|
15
15
|
bindir: bin
|
|
16
16
|
cert_chain: []
|
|
17
17
|
|
|
18
|
-
date: 2010-06-
|
|
18
|
+
date: 2010-06-18 00:00:00 +02:00
|
|
19
19
|
default_executable:
|
|
20
20
|
dependencies:
|
|
21
21
|
- !ruby/object:Gem::Dependency
|