Class: TerraformEnterprise::API::Resource
- Inherits:
-
Object
- Object
- TerraformEnterprise::API::Resource
- Defined in:
- lib/terraform-enterprise/client/resource.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#errors ⇒ Object
Returns the value of attribute errors.
-
#id ⇒ Object
Returns the value of attribute id.
-
#links ⇒ Object
Returns the value of attribute links.
-
#relationships ⇒ Object
Returns the value of attribute relationships.
-
#success ⇒ Object
Returns the value of attribute success.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #has_errors? ⇒ Boolean
-
#initialize(data) ⇒ Resource
constructor
A new instance of Resource.
Constructor Details
#initialize(data) ⇒ Resource
Returns a new instance of Resource.
5 6 7 8 9 10 11 12 |
# File 'lib/terraform-enterprise/client/resource.rb', line 5 def initialize(data) @id = data['id'] @type = data['type'] @attributes = data['attributes'] || {} @relationships = data['relationships'] || {} @links = data['links'] || [] @errors = data['errors'] || [] end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
4 5 6 |
# File 'lib/terraform-enterprise/client/resource.rb', line 4 def attributes @attributes end |
#errors ⇒ Object
Returns the value of attribute errors.
4 5 6 |
# File 'lib/terraform-enterprise/client/resource.rb', line 4 def errors @errors end |
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/terraform-enterprise/client/resource.rb', line 4 def id @id end |
#links ⇒ Object
Returns the value of attribute links.
4 5 6 |
# File 'lib/terraform-enterprise/client/resource.rb', line 4 def links @links end |
#relationships ⇒ Object
Returns the value of attribute relationships.
4 5 6 |
# File 'lib/terraform-enterprise/client/resource.rb', line 4 def relationships @relationships end |
#success ⇒ Object
Returns the value of attribute success.
4 5 6 |
# File 'lib/terraform-enterprise/client/resource.rb', line 4 def success @success end |
#type ⇒ Object
Returns the value of attribute type.
4 5 6 |
# File 'lib/terraform-enterprise/client/resource.rb', line 4 def type @type end |
Instance Method Details
#has_errors? ⇒ Boolean
14 15 16 |
# File 'lib/terraform-enterprise/client/resource.rb', line 14 def has_errors? !@errors.empty? end |