Class: Spice::Environment
- Inherits:
-
Object
- Object
- Spice::Environment
- Extended by:
- Persistence
- Includes:
- Persistence, Toy::Store
- Defined in:
- lib/spice/environment.rb
Instance Attribute Summary (collapse)
-
- (Hash) attrs
The attrs attribute.
-
- (String) chef_type
The chef_type attribute.
-
- (Hash) cookbook_versions
The cookbook_versions attribute.
-
- (String) description
The description attribute.
-
- (String) json_class
The json_class attribute.
-
- (String) name
The name attribute.
Instance Method Summary (collapse)
-
- (Boolean) new_record?
Check if the environment exists on the Chef server.
Methods included from Persistence
all, connection, do_delete, do_post, do_put, endpoint, get, included
Instance Attribute Details
- (Hash) attrs
The attrs attribute
16 |
# File 'lib/spice/environment.rb', line 16 attribute :attrs, Hash, :default => {} |
- (String) chef_type
The chef_type attribute
18 |
# File 'lib/spice/environment.rb', line 18 attribute :chef_type, String, :default => "environment" |
- (Hash) cookbook_versions
The cookbook_versions attribute
19 |
# File 'lib/spice/environment.rb', line 19 attribute :cookbook_versions, Hash, :default => {} |
- (String) description
The description attribute
15 |
# File 'lib/spice/environment.rb', line 15 attribute :description, String |
- (String) json_class
The json_class attribute
17 |
# File 'lib/spice/environment.rb', line 17 attribute :json_class, String, :default => "Chef::Environment" |
- (String) name
The name attribute
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 |