Class: Fclay::RemoteStorage
- Inherits:
-
Object
- Object
- Fclay::RemoteStorage
- Defined in:
- lib/fclay/remote_storage.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #bucket_name ⇒ Object
- #bucket_object ⇒ Object
-
#initialize(name, data) ⇒ RemoteStorage
constructor
A new instance of RemoteStorage.
- #s3? ⇒ Boolean
Constructor Details
#initialize(name, data) ⇒ RemoteStorage
Returns a new instance of RemoteStorage.
6 7 8 9 |
# File 'lib/fclay/remote_storage.rb', line 6 def initialize name,data @name = name.to_s @data = data end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/fclay/remote_storage.rb', line 4 def name @name end |
Instance Method Details
#bucket_name ⇒ Object
21 22 23 24 |
# File 'lib/fclay/remote_storage.rb', line 21 def bucket_name return "" unless s3? @data[:bucket] end |
#bucket_object ⇒ Object
15 16 17 18 19 |
# File 'lib/fclay/remote_storage.rb', line 15 def bucket_object return nil if !@data || !s3? s3 = Aws::S3::Resource.new s3.bucket(bucket_name) end |
#s3? ⇒ Boolean
11 12 13 |
# File 'lib/fclay/remote_storage.rb', line 11 def s3? @data[:kind] == "s3" end |