bodhi-slam 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bodhi-slam.rb +11 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aebbd3db6ff0172b4f7c75c0904c0bd32342cae8
|
4
|
+
data.tar.gz: 21fa5160b6874bf4e1a0c03cafef586fb0c7b001
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ede1f19f9b62ae410eff5cabf7b776c1e9bbb2d01a55652e754925ed59635b9e3f1545b3a0489775d7ca8beb1ee9b1256a745e05cccfcb8ab8021f3b4bf8559
|
7
|
+
data.tar.gz: ab20c11285b9aac39b5e4452c52abf54352735d58b3c1ab0c44f9e7f8d67fb2dac01978a0131b297562679e462d9bc76d9d3e4e3ca1ee6789f24304b956f0ce2
|
data/lib/bodhi-slam.rb
CHANGED
@@ -178,18 +178,25 @@ module BodhiResource
|
|
178
178
|
:sys_namespace, :sys_created_by, :sys_type_version, :sys_id]
|
179
179
|
attr_accessor *SYSTEM_ATTRIBUTES
|
180
180
|
|
181
|
-
# - Returns a Hash of the
|
181
|
+
# - Returns a Hash of the Objects form attributes
|
182
182
|
def attributes
|
183
183
|
attributes = Hash.new
|
184
184
|
self.instance_variables.each do |variable|
|
185
|
-
#Convert :@variable to :variable
|
186
185
|
attribute_name = variable.to_s.delete('@').to_sym
|
187
|
-
#Get the value of :attribute_name and add it to the Hash
|
188
|
-
#Unless the attribute is one of the BASE_ATTRIBUTES
|
189
186
|
attributes[attribute_name] = send(attribute_name) unless SYSTEM_ATTRIBUTES.include?(attribute_name)
|
190
187
|
end
|
191
188
|
attributes
|
192
189
|
end
|
190
|
+
|
191
|
+
# - Converts all the Objects attributes to JSON
|
192
|
+
def to_json
|
193
|
+
attributes = Hash.new
|
194
|
+
self.instance_variables.each do |variable|
|
195
|
+
attribute_name = variable.to_s.delete('@').to_sym
|
196
|
+
attributes[attribute_name] = send(attribute_name)
|
197
|
+
end
|
198
|
+
attributes.to_json
|
199
|
+
end
|
193
200
|
|
194
201
|
def save!
|
195
202
|
result = bodhi_context.connection.post do |request|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bodhi-slam
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Will Davis
|
@@ -52,7 +52,7 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.7'
|
55
|
-
description: Generate data
|
55
|
+
description: Generate data and push to the Bodhi API
|
56
56
|
email: will.davis@hotschedules.com
|
57
57
|
executables: []
|
58
58
|
extensions: []
|