Class: KeeperSecretsManager::Dto::KeeperFile
- Inherits:
-
Object
- Object
- KeeperSecretsManager::Dto::KeeperFile
- Defined in:
- lib/keeper_secrets_manager/dto.rb
Overview
File attachment representation
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#file_key ⇒ Object
Returns the value of attribute file_key.
-
#last_modified ⇒ Object
Returns the value of attribute last_modified.
-
#mime_type ⇒ Object
Returns the value of attribute mime_type.
-
#name ⇒ Object
Returns the value of attribute name.
-
#size ⇒ Object
Returns the value of attribute size.
-
#thumbnail_url ⇒ Object
Returns the value of attribute thumbnail_url.
-
#title ⇒ Object
Returns the value of attribute title.
-
#uid ⇒ Object
Returns the value of attribute uid.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ KeeperFile
constructor
A new instance of KeeperFile.
- #to_h ⇒ Object
Constructor Details
#initialize(attrs = {}) ⇒ KeeperFile
Returns a new instance of KeeperFile.
487 488 489 490 491 492 493 494 495 496 497 498 |
# File 'lib/keeper_secrets_manager/dto.rb', line 487 def initialize(attrs = {}) @uid = attrs['fileUid'] || attrs['uid'] || attrs[:uid] @name = attrs['name'] || attrs[:name] @title = attrs['title'] || attrs[:title] || @name @mime_type = attrs['mimeType'] || attrs['mime_type'] || attrs[:mime_type] @size = attrs['size'] || attrs[:size] @data = attrs['data'] || attrs[:data] @url = attrs['url'] || attrs[:url] @thumbnail_url = attrs['thumbnailUrl'] || attrs['thumbnail_url'] || attrs[:thumbnail_url] @last_modified = attrs['lastModified'] || attrs['last_modified'] || attrs[:last_modified] @file_key = attrs['fileKey'] || attrs['file_key'] || attrs[:file_key] end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
485 486 487 |
# File 'lib/keeper_secrets_manager/dto.rb', line 485 def data @data end |
#file_key ⇒ Object
Returns the value of attribute file_key.
485 486 487 |
# File 'lib/keeper_secrets_manager/dto.rb', line 485 def file_key @file_key end |
#last_modified ⇒ Object
Returns the value of attribute last_modified.
485 486 487 |
# File 'lib/keeper_secrets_manager/dto.rb', line 485 def last_modified @last_modified end |
#mime_type ⇒ Object
Returns the value of attribute mime_type.
485 486 487 |
# File 'lib/keeper_secrets_manager/dto.rb', line 485 def mime_type @mime_type end |
#name ⇒ Object
Returns the value of attribute name.
485 486 487 |
# File 'lib/keeper_secrets_manager/dto.rb', line 485 def name @name end |
#size ⇒ Object
Returns the value of attribute size.
485 486 487 |
# File 'lib/keeper_secrets_manager/dto.rb', line 485 def size @size end |
#thumbnail_url ⇒ Object
Returns the value of attribute thumbnail_url.
485 486 487 |
# File 'lib/keeper_secrets_manager/dto.rb', line 485 def thumbnail_url @thumbnail_url end |
#title ⇒ Object
Returns the value of attribute title.
485 486 487 |
# File 'lib/keeper_secrets_manager/dto.rb', line 485 def title @title end |
#uid ⇒ Object
Returns the value of attribute uid.
485 486 487 |
# File 'lib/keeper_secrets_manager/dto.rb', line 485 def uid @uid end |
#url ⇒ Object
Returns the value of attribute url.
485 486 487 |
# File 'lib/keeper_secrets_manager/dto.rb', line 485 def url @url end |
Instance Method Details
#to_h ⇒ Object
500 501 502 503 504 505 506 507 508 |
# File 'lib/keeper_secrets_manager/dto.rb', line 500 def to_h { 'fileUid' => uid, 'name' => name, 'title' => title, 'mimeType' => mime_type, 'size' => size }.compact end |