version-one 0.0.2 → 0.0.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.
@@ -11,6 +11,10 @@ module VersionOne
11
11
  rank: Integer
12
12
  }.freeze
13
13
 
14
+ ASSET_FORM_MAP = {
15
+ 'Scope' => 'Project'
16
+ }
17
+
14
18
  attr_reader :type,
15
19
  :href,
16
20
  :meta,
@@ -87,6 +91,25 @@ module VersionOne
87
91
  @id
88
92
  end
89
93
 
94
+ def url
95
+ unless @url
96
+ uri = service_uri.dup
97
+ uri.path = href
98
+ @url = uri.to_s
99
+ end
100
+ @url
101
+ end
102
+
103
+ def display_url
104
+ unless @display_url
105
+ uri = service_uri.dup
106
+ uri.path = File.join(uri.path, "#{ASSET_FORM_MAP[@type] || @type}.mvc/Summary")
107
+ uri.query = URI.encode_www_form('oidToken' => self.id)
108
+ @display_url = uri.to_s
109
+ end
110
+ @display_url
111
+ end
112
+
90
113
  def ref
91
114
  AssertRef.for(self)
92
115
  end
@@ -180,6 +203,10 @@ module VersionOne
180
203
 
181
204
  private
182
205
 
206
+ def service_uri
207
+ VersionOne::Client.service_uri
208
+ end
209
+
183
210
  def init_attribute_value(el)
184
211
  attr_name = el.attributes['name']
185
212
 
@@ -1,3 +1,3 @@
1
1
  module VersionOne
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: version-one
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-09-22 00:00:00.000000000 Z
12
+ date: 2014-09-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: libxml-ruby