Class: Spice::Environment

Inherits:
Object
  • Object
show all
Extended by:
Persistence
Includes:
Persistence, Toy::Store
Defined in:
lib/spice/environment.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Methods included from Persistence

all, connection, do_delete, do_post, do_put, endpoint, get, included

Instance Attribute Details

- (Hash) attrs



16
# File 'lib/spice/environment.rb', line 16

attribute :attrs, Hash, :default => {}

- (String) chef_type



18
# File 'lib/spice/environment.rb', line 18

attribute :chef_type, String, :default => "environment"

- (Hash) cookbook_versions



19
# File 'lib/spice/environment.rb', line 19

attribute :cookbook_versions, Hash, :default => {}

- (String) description



15
# File 'lib/spice/environment.rb', line 15

attribute :description, String

- (String) json_class



17
# File 'lib/spice/environment.rb', line 17

attribute :json_class, String, :default => "Chef::Environment"

- (String) name



14
# File 'lib/spice/environment.rb', line 14

attribute :name, String

Instance Method Details

- (Boolean) new_record?

Check if the environment exists on the Chef server



24
25
26
27
28
29
# File 'lib/spice/environment.rb', line 24

def new_record?
  connection.get("/environments/#{name}")
  return false
rescue Spice::Error::NotFound
  return true
end