class MyBitcasa::Directory
Attributes
bottom[RW]
path[RW]
seamless[RW]
show_incomplete[RW]
sort_ascending[RW]
sort_column[RW]
top[RW]
Public Class Methods
new(path, top: 0, bottom: 500, sort_column: :name, sort_ascending: true, show_incomplete: true, seamless: true)
click to toggle source
# File lib/my_bitcasa/directory.rb, line 17 def initialize(path, top: 0, bottom: 500, sort_column: :name, sort_ascending: true, show_incomplete: true, seamless: true) @path = path.sub(/^\/?/, "/") @top = top @bottom = bottom @sort_column = sort_column @sort_ascending = sort_ascending @show_incomplete = show_incomplete @seamless = seamless end
Public Instance Methods
each() { |create| ... }
click to toggle source
# File lib/my_bitcasa/directory.rb, line 27 def each top = @top begin res = connection.get {|req| req.url Connection.uri_encode("/directory#{@path}") req.params = { top: top, bottom: @bottom, sort_column: @sort_column, sort_ascending: @sort_ascending, "show-incomplete" => @show_incomplete, } } sentinel = res.body["sentinel"] length = res.body["length"] top = res.body["range"]["top"] bottom = res.body["range"]["bottom"] name = res.body["name"] items = res.body["items"] items.each do |item| yield BitcasaItem.create(item) end if length<=bottom break end end while @seamless end