Class: FTPMVC::Driver
- Inherits:
-
Object
- Object
- FTPMVC::Driver
- Defined in:
- lib/ftpmvc/driver.rb
Instance Method Summary collapse
- #authenticate(username, password) {|true| ... } ⇒ Object
- #bytes(path) {|@application.size(path)| ... } ⇒ Object
- #change_dir(path) {|@application.directory?(path)| ... } ⇒ Object
- #dir_contents(path) {|@application.index(path).map { |node| EM::FTPD::DirectoryItem.new(name: node.name) }| ... } ⇒ Object
- #get_file(path) {|@application.get(path)| ... } ⇒ Object
-
#initialize(application) ⇒ Driver
constructor
A new instance of Driver.
Constructor Details
#initialize(application) ⇒ Driver
Returns a new instance of Driver.
6 7 8 |
# File 'lib/ftpmvc/driver.rb', line 6 def initialize(application) @application = application end |
Instance Method Details
#authenticate(username, password) {|true| ... } ⇒ Object
14 15 16 |
# File 'lib/ftpmvc/driver.rb', line 14 def authenticate(username, password) yield true end |
#bytes(path) {|@application.size(path)| ... } ⇒ Object
26 27 28 |
# File 'lib/ftpmvc/driver.rb', line 26 def bytes(path) yield @application.size(path) end |
#change_dir(path) {|@application.directory?(path)| ... } ⇒ Object
18 19 20 |
# File 'lib/ftpmvc/driver.rb', line 18 def change_dir(path) yield @application.directory?(path) end |
#dir_contents(path) {|@application.index(path).map { |node| EM::FTPD::DirectoryItem.new(name: node.name) }| ... } ⇒ Object
10 11 12 |
# File 'lib/ftpmvc/driver.rb', line 10 def dir_contents(path) yield @application.index(path).map { |node| EM::FTPD::DirectoryItem.new(name: node.name) } end |
#get_file(path) {|@application.get(path)| ... } ⇒ Object
22 23 24 |
# File 'lib/ftpmvc/driver.rb', line 22 def get_file(path) yield @application.get(path) end |