Class: SemaphoreClient::Model::EnvVar
- Inherits:
-
Object
- Object
- SemaphoreClient::Model::EnvVar
- Defined in:
- lib/semaphore_client/model/env_var.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#encrypted ⇒ Object
readonly
Returns the value of attribute encrypted.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#shared ⇒ Object
readonly
Returns the value of attribute shared.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
5 6 7 |
# File 'lib/semaphore_client/model/env_var.rb', line 5 def content @content end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
4 5 6 |
# File 'lib/semaphore_client/model/env_var.rb', line 4 def created_at @created_at end |
#encrypted ⇒ Object (readonly)
Returns the value of attribute encrypted.
4 5 6 |
# File 'lib/semaphore_client/model/env_var.rb', line 4 def encrypted @encrypted end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/semaphore_client/model/env_var.rb', line 4 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/semaphore_client/model/env_var.rb', line 5 def name @name end |
#shared ⇒ Object (readonly)
Returns the value of attribute shared.
4 5 6 |
# File 'lib/semaphore_client/model/env_var.rb', line 4 def shared @shared end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
4 5 6 |
# File 'lib/semaphore_client/model/env_var.rb', line 4 def updated_at @updated_at end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
4 5 6 |
# File 'lib/semaphore_client/model/env_var.rb', line 4 def url @url end |
Class Method Details
.create(attributes) ⇒ Object
11 12 13 |
# File 'lib/semaphore_client/model/env_var.rb', line 11 def self.create(attributes) new.update(attributes) end |
.load(attributes) ⇒ Object
7 8 9 |
# File 'lib/semaphore_client/model/env_var.rb', line 7 def self.load(attributes) new.load(attributes) end |
Instance Method Details
#load(attributes) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/semaphore_client/model/env_var.rb', line 15 def load(attributes) attributes = symbolize_keys(attributes) @id = attributes[:id] if attributes.key?(:id) @name = attributes[:name] if attributes.key?(:name) @url = attributes[:url] if attributes.key?(:url) @content = attributes[:content] if attributes.key?(:content) @shared = attributes[:shared] if attributes.key?(:shared) @encrypted = attributes[:encrypted] if attributes.key?(:encrypted) @created_at = attributes[:created_at] if attributes.key?(:created_at) @updated_at = attributes[:updated_at] if attributes.key?(:updated_at) self end |
#serialize ⇒ Object
45 46 47 48 49 50 51 52 |
# File 'lib/semaphore_client/model/env_var.rb', line 45 def serialize object_hash = { "name" => @name, "content" => @content, } object_hash.delete_if { |_, value| value.nil? } end |
#update(attributes) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/semaphore_client/model/env_var.rb', line 30 def update(attributes) attributes = symbolize_keys(attributes) updatable_keys = [:name, :content] if (attributes.keys - updatable_keys).any? raise SemaphoreClient::Exceptions::AttributeNotAvailable end @name = attributes[:name] if attributes.key?(:name) @content = attributes[:content] if attributes.key?(:content) self end |