osc_ruby 0.1.7 → 0.1.8

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: eb080accc3a67a280bca61dd9457f02ff24424b4
4
- data.tar.gz: f0203e3b6191ea8bc91f67d6300ae78cbe06e06c
3
+ metadata.gz: 9479c24f1242d139221ddebe5f651f9daa9a2352
4
+ data.tar.gz: 693034d0a473d3069c2072800991f7342ea0e793
5
5
  SHA512:
6
- metadata.gz: 5d94cab4451152c8be35f0701436fbe72b57ef6ce1604b0dec79d91d83f3a69bfe6471e21bb7604e02b66ec8dd518f9b85a19967e4069ba01be7afea796eddf5
7
- data.tar.gz: 22240e2be5593b5797a65e91b48d3f97320d257dd9ba220073d5c8b6e06baba956cbfea71e6787b89dedfb42362b35bafc335dd5d424bd5fd30208c9f423ea6d
6
+ metadata.gz: 7f53b5e08cb805f9c511128746d6b1a96e4abc79a5c7690b77e0284c1972505be4764ecf5cdf2d51be11629999f6983f2f41145bb4ebc94735ec06554ff79a06
7
+ data.tar.gz: fa8ce0a80ee596922beeb91242e0e9b819fa91badb58aad140d716806cdeeacba4fd41c9e66c495835fd2ec168f9472310e969cd1dab476a828819d9692ab99a
data/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  An (under development) Ruby ORM for using Oracle Service Cloud influenced by the [ConnectPHP API](http://documentation.custhelp.com/euf/assets/devdocs/november2016/Connect_PHP/Default.htm) and ActiveRecord Gem
6
6
 
7
7
  ## Example (still coding this out, but trying to get this pretty simple)
8
-
8
+ ```ruby
9
9
  # Configuration is as simple as requiring the gem
10
10
  # and adding a config block (Completed 12/2016)
11
11
 
@@ -89,6 +89,7 @@ An (under development) Ruby ORM for using Oracle Service Cloud influenced by the
89
89
  product_to_delete.destroy(rn_client)
90
90
 
91
91
  # ServiceProduct destroyed
92
+ ```
92
93
 
93
94
  ## To do list
94
95
 
@@ -9,9 +9,7 @@ module OSCRuby
9
9
 
10
10
  include QueryModule
11
11
 
12
- attr_reader :id, :lookupName, :createdTime, :updatedTime, :name
13
-
14
- attr_accessor :names, :parent, :displayOrder, :adminVisibleInterfaces, :endUserVisibleInterfaces
12
+ attr_accessor :names, :parent, :displayOrder, :adminVisibleInterfaces, :endUserVisibleInterfaces, :id, :lookupName, :createdTime, :updatedTime, :name
15
13
 
16
14
  def initialize(attributes = nil)
17
15
 
@@ -59,19 +57,25 @@ module OSCRuby
59
57
 
60
58
  response = QueryModule::create(client,resource,final_json)
61
59
 
62
- if response.code == 200 && return_json == false
60
+ response_body = JSON.parse(response.body)
61
+
62
+ puts response_body
63
+
64
+ if response.code.to_i == 201 && return_json == false
65
+
66
+ self.id = response_body['id'].to_i
63
67
 
64
- prod_json = JSON.parse(response.body)
68
+ self.name = response_body['name']
65
69
 
66
- final_prod = new_from_fetch(prod_json[0])
70
+ self.lookupName = response_body["lookupName"]
67
71
 
68
- puts "New product ${final_prod.name} was created"
72
+ self.displayOrder = response_body["displayOrder"]
69
73
 
70
- final_prod
74
+ self.parent = response_body["parent"]
71
75
 
72
76
  elsif return_json == true
73
77
 
74
- puts response.body
78
+ response.body
75
79
 
76
80
  end
77
81
 
@@ -1,3 +1,3 @@
1
1
  module OSCRuby
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
@@ -146,16 +146,29 @@ describe OSCRuby::ServiceProduct do
146
146
  new_service_product.names[0] = {"labelText" => "QTH45-test", "language" => {"id" => 1}}
147
147
  new_service_product.names[1] = {'labelText' => 'QTH45-test', 'language' => {'id' => 11}}
148
148
 
149
+ new_service_product.parent = {'id' => 102}
150
+
151
+ new_service_product.displayOrder = 4
152
+
149
153
  new_service_product.create(client)
150
154
 
151
155
  expect(new_service_product).to be_a(OSCRuby::ServiceProduct)
152
156
 
157
+ expect(new_service_product.name).to eq("QTH45-test")
158
+
159
+ expect(new_service_product.lookupName).to eq("QTH45-test")
160
+
161
+ expect(new_service_product.displayOrder).to eq(4)
162
+
163
+ # expect(new_service_product.parent).to eq(102)
164
+
153
165
  end
154
166
 
155
167
 
156
168
  it 'should return the body object if the json_response param is set to true' do
157
169
 
158
- new_service_product.names[0] = {"labelText" => "QTH45-test", "language" => {"id" => 1}}
170
+ new_service_product.names[0] = {"labelText" => "QTH45-test", "language" => {"id" => 1}}
171
+ new_service_product.names[1] = {'labelText' => 'QTH45-test', 'language' => {'id' => 11}}
159
172
 
160
173
  expect(new_service_product.create(client,true)).to be_a(String)
161
174
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: osc_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rajan Davis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-04 00:00:00.000000000 Z
11
+ date: 2017-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler