Class: FTPMVC::Driver

Inherits:
Object
  • Object
show all
Defined in:
lib/ftpmvc/driver.rb

Instance Method Summary collapse

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

Yields:

  • (true)


14
15
16
# File 'lib/ftpmvc/driver.rb', line 14

def authenticate(username, password)
  yield true
end

#bytes(path) {|@application.size(path)| ... } ⇒ Object

Yields:

  • (@application.size(path))


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

Yields:

  • (@application.directory?(path))


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

Yields:

  • (@application.index(path).map { |node| EM::FTPD::DirectoryItem.new(name: node.name) })


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

Yields:

  • (@application.get(path))


22
23
24
# File 'lib/ftpmvc/driver.rb', line 22

def get_file(path)
  yield @application.get(path)
end