Class: NgrokAPI::Models::Vault
- Inherits:
-
Object
- Object
- NgrokAPI::Models::Vault
- Defined in:
- lib/ngrokapi/models/vault.rb
Instance Attribute Summary collapse
-
#attrs ⇒ Object
readonly
Returns the value of attribute attrs.
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#created_by ⇒ Object
readonly
Returns the value of attribute created_by.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#last_updated_by ⇒ Object
readonly
Returns the value of attribute last_updated_by.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#delete ⇒ Object
Delete a Vault.
-
#initialize(client: nil, attrs: {}) ⇒ Vault
constructor
A new instance of Vault.
- #to_h ⇒ Object
- #to_s ⇒ Object
-
#update(name: nil, metadata: nil, description: nil) ⇒ Object
Update an existing Vault by ID.
Constructor Details
#initialize(client: nil, attrs: {}) ⇒ Vault
Returns a new instance of Vault.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/ngrokapi/models/vault.rb', line 22 def initialize(client: nil, attrs: {}) @client = client @attrs = attrs @id = @attrs['id'] unless @attrs['uri'].nil? @uri = URI(@attrs['uri']) end @created_at = @attrs['created_at'] @updated_at = @attrs['updated_at'] @name = @attrs['name'] @description = @attrs['description'] @metadata = @attrs['metadata'] @created_by = @attrs['created_by'] @last_updated_by = @attrs['last_updated_by'] end |
Instance Attribute Details
#attrs ⇒ Object (readonly)
Returns the value of attribute attrs.
10 11 12 |
# File 'lib/ngrokapi/models/vault.rb', line 10 def attrs @attrs end |
#client ⇒ Object (readonly)
Returns the value of attribute client.
10 11 12 |
# File 'lib/ngrokapi/models/vault.rb', line 10 def client @client end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
10 11 12 |
# File 'lib/ngrokapi/models/vault.rb', line 10 def created_at @created_at end |
#created_by ⇒ Object (readonly)
Returns the value of attribute created_by.
10 11 12 |
# File 'lib/ngrokapi/models/vault.rb', line 10 def created_by @created_by end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
10 11 12 |
# File 'lib/ngrokapi/models/vault.rb', line 10 def description @description end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
10 11 12 |
# File 'lib/ngrokapi/models/vault.rb', line 10 def id @id end |
#last_updated_by ⇒ Object (readonly)
Returns the value of attribute last_updated_by.
10 11 12 |
# File 'lib/ngrokapi/models/vault.rb', line 10 def last_updated_by @last_updated_by end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
10 11 12 |
# File 'lib/ngrokapi/models/vault.rb', line 10 def @metadata end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
10 11 12 |
# File 'lib/ngrokapi/models/vault.rb', line 10 def name @name end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
10 11 12 |
# File 'lib/ngrokapi/models/vault.rb', line 10 def updated_at @updated_at end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
10 11 12 |
# File 'lib/ngrokapi/models/vault.rb', line 10 def uri @uri end |
Instance Method Details
#==(other) ⇒ Object
38 39 40 |
# File 'lib/ngrokapi/models/vault.rb', line 38 def ==(other) @attrs == other.attrs end |
#delete ⇒ Object
Delete a Vault
74 75 76 77 78 |
# File 'lib/ngrokapi/models/vault.rb', line 74 def delete @client.delete( id: @id ) end |
#to_h ⇒ Object
46 47 48 |
# File 'lib/ngrokapi/models/vault.rb', line 46 def to_h @attrs.to_h end |
#to_s ⇒ Object
42 43 44 |
# File 'lib/ngrokapi/models/vault.rb', line 42 def to_s @attrs.to_s end |
#update(name: nil, metadata: nil, description: nil) ⇒ Object
Update an existing Vault by ID
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/ngrokapi/models/vault.rb', line 54 def update( name: nil, metadata: nil, description: nil ) @name = name if name @metadata = if @description = description if description @client.update( id: @id, name: name, metadata: , description: description ) end |