Class: Bl::File
Instance Method Summary collapse
- #get(*ids) ⇒ Object
-
#initialize ⇒ File
constructor
A new instance of File.
- #list(path = '') ⇒ Object
Methods included from Printer
print_response, printable_issues
Methods included from Formatting
colorize_priority, colorize_status, colorize_type
Methods included from Requestable
Constructor Details
Instance Method Details
#get(*ids) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/bl/file.rb', line 16 def get(*ids) ids.each do |id| res = request(:get, "#{@url}/files/#{id}") f = ::File.new(res.body.filename, 'w') f.write(res.body.content) f.close puts "file #{id} #{res.body.filename} downloaded." end end |
#list(path = '') ⇒ Object
10 11 12 13 |
# File 'lib/bl/file.rb', line 10 def list(path = '') res = request(:get, "#{@url}/files/metadata/#{path}") print_response(res) end |