Module: Seaweed
- Defined in:
- lib/seaweed.rb
Defined Under Namespace
Classes: File, HTTP, Master
Class Method Summary
collapse
Class Method Details
.connect(host: "localhost", port: 9333, http_options: {}) ⇒ Object
.find(fid, http_options: nil) ⇒ Object
18
19
20
21
|
# File 'lib/seaweed.rb', line 18
def self.find(fid, http_options: nil)
location = Seaweed::Master.dir_lookup fid.split(",")[0]
Seaweed::File.new fid, volume_url: location[:url]
end
|
.upload(path) ⇒ Object
12
13
14
15
16
|
# File 'lib/seaweed.rb', line 12
def self.upload(path)
location = Seaweed::Master.dir_assign!
file = Seaweed::File.new location[:fid], volume_url: location[:url], attachment: path
file.upload!
end
|