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.
-
#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.
-
#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
184 185 186 187 188 189 190 191 192 |
# File 'lib/keeper_secrets_manager/dto.rb', line 184 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] end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
182 183 184 |
# File 'lib/keeper_secrets_manager/dto.rb', line 182 def data @data end |
#mime_type ⇒ Object
Returns the value of attribute mime_type.
182 183 184 |
# File 'lib/keeper_secrets_manager/dto.rb', line 182 def mime_type @mime_type end |
#name ⇒ Object
Returns the value of attribute name.
182 183 184 |
# File 'lib/keeper_secrets_manager/dto.rb', line 182 def name @name end |
#size ⇒ Object
Returns the value of attribute size.
182 183 184 |
# File 'lib/keeper_secrets_manager/dto.rb', line 182 def size @size end |
#title ⇒ Object
Returns the value of attribute title.
182 183 184 |
# File 'lib/keeper_secrets_manager/dto.rb', line 182 def title @title end |
#uid ⇒ Object
Returns the value of attribute uid.
182 183 184 |
# File 'lib/keeper_secrets_manager/dto.rb', line 182 def uid @uid end |
#url ⇒ Object
Returns the value of attribute url.
182 183 184 |
# File 'lib/keeper_secrets_manager/dto.rb', line 182 def url @url end |
Instance Method Details
#to_h ⇒ Object
194 195 196 197 198 199 200 201 202 |
# File 'lib/keeper_secrets_manager/dto.rb', line 194 def to_h { 'fileUid' => uid, 'name' => name, 'title' => title, 'mimeType' => mime_type, 'size' => size }.compact end |