Class: Blobsterix::BlobAccess
- Inherits:
-
Object
- Object
- Blobsterix::BlobAccess
- Defined in:
- lib/blobsterix/helper/blob_access.rb
Instance Attribute Summary collapse
-
#accept_type ⇒ Object
readonly
Returns the value of attribute accept_type.
-
#bucket ⇒ Object
readonly
Returns the value of attribute bucket.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
-
#trafo ⇒ Object
readonly
Returns the value of attribute trafo.
Instance Method Summary collapse
- #copy ⇒ Object
- #equals?(blob_access) ⇒ Boolean
- #get ⇒ Object
- #identifier ⇒ Object
-
#initialize(atts = {}) ⇒ BlobAccess
constructor
A new instance of BlobAccess.
- #reset! ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(atts = {}) ⇒ BlobAccess
Returns a new instance of BlobAccess.
6 7 8 9 10 |
# File 'lib/blobsterix/helper/blob_access.rb', line 6 def initialize(atts={}) @trafo = [] atts.each do |key,value| send("#{key}=",value) end identifier end |
Instance Attribute Details
#accept_type ⇒ Object
Returns the value of attribute accept_type.
3 4 5 |
# File 'lib/blobsterix/helper/blob_access.rb', line 3 def accept_type @accept_type end |
#bucket ⇒ Object
Returns the value of attribute bucket.
3 4 5 |
# File 'lib/blobsterix/helper/blob_access.rb', line 3 def bucket @bucket end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/blobsterix/helper/blob_access.rb', line 3 def id @id end |
#source ⇒ Object
Returns the value of attribute source.
4 5 6 |
# File 'lib/blobsterix/helper/blob_access.rb', line 4 def source @source end |
#target ⇒ Object
Returns the value of attribute target.
4 5 6 |
# File 'lib/blobsterix/helper/blob_access.rb', line 4 def target @target end |
#trafo ⇒ Object
Returns the value of attribute trafo.
3 4 5 |
# File 'lib/blobsterix/helper/blob_access.rb', line 3 def trafo @trafo end |
Instance Method Details
#copy ⇒ Object
28 29 30 |
# File 'lib/blobsterix/helper/blob_access.rb', line 28 def copy BlobAccess.new(:bucket => bucket, :id => id, :trafo => trafo, :accept_type => accept_type, :source => source, :target => target) end |
#equals?(blob_access) ⇒ Boolean
24 25 26 |
# File 'lib/blobsterix/helper/blob_access.rb', line 24 def equals?(blob_access) identifier == blob_access.identifier end |
#get ⇒ Object
20 21 22 |
# File 'lib/blobsterix/helper/blob_access.rb', line 20 def get @meta||=find_blob end |
#identifier ⇒ Object
12 13 14 |
# File 'lib/blobsterix/helper/blob_access.rb', line 12 def identifier @identifier||= "#{bucket}_#{id.gsub("/","_")}_#{trafo.map {|trafo_pair|"#{trafo_pair[0]}_#{trafo_pair[1]}"}.join(",")}.#{subtype}" end |
#reset! ⇒ Object
32 33 34 35 |
# File 'lib/blobsterix/helper/blob_access.rb', line 32 def reset! @meta = nil self end |
#to_s ⇒ Object
16 17 18 |
# File 'lib/blobsterix/helper/blob_access.rb', line 16 def to_s "BlobAccess: bucket(#{bucket}), id(#{id}), trafo(#{trafo}), accept_type(#{accept_type})" end |