Class: ActiveStorage::BlobKey

Inherits:
String show all
Defined in:
lib/active_storage/blob_key.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from String

#blank?

Constructor Details

#initialize(attributes) ⇒ BlobKey

Returns a new instance of BlobKey.



9
10
11
12
13
14
15
16
17
18
# File 'lib/active_storage/blob_key.rb', line 9

def initialize(attributes)
  if attributes.is_a? Hash
    attributes.symbolize_keys!
    super(attributes[:key])
    @attributes = attributes
  else
    super(attributes)
    @attributes = {key: attributes} if attributes
  end
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



8
9
10
# File 'lib/active_storage/blob_key.rb', line 8

def attributes
  @attributes
end