Class: ActiveStorage::BlobKey
- Defined in:
- lib/active_storage/blob_key.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#initialize(attributes) ⇒ BlobKey
constructor
A new instance of BlobKey.
Methods inherited from String
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
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
8 9 10 |
# File 'lib/active_storage/blob_key.rb', line 8 def attributes @attributes end |