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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/bodhi-slam.rb +11 -4
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a5847a2624bbebdcca10694961184c705fe2a291
4
- data.tar.gz: 2cc55276b1d0d2f56334ed704e638655c8c10715
3
+ metadata.gz: aebbd3db6ff0172b4f7c75c0904c0bd32342cae8
4
+ data.tar.gz: 21fa5160b6874bf4e1a0c03cafef586fb0c7b001
5
5
  SHA512:
6
- metadata.gz: 9a42e6cb3c52fec9c87d124bd7f45c81ec3111a58ed2d64579167cb471db55681f3501d4276590f83c639f08c203505052a2447093f73c9814979bdcf7a59575
7
- data.tar.gz: 1374f972b39667ccf2d56b21c346cd5c7cbed9dfa073828d822d6501febd1ccf09ee2a8ec6277acca86d54f2734a7b119277248ec434ec0a0a48e6010ec1bb44
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 objects attributes
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.1
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 in serial or parallel
55
+ description: Generate data and push to the Bodhi API
56
56
  email: will.davis@hotschedules.com
57
57
  executables: []
58
58
  extensions: []