class HylaFAX::Command

Constants

DEFAULT_HOST
DEFAULT_PASSWORD
DEFAULT_PORT
DEFAULT_USER

Attributes

ftp[R]
host[R]
password[R]
port[R]
user[R]

Public Class Methods

new(opts = {}) click to toggle source
# File lib/hylafax/command.rb, line 10
def initialize(opts = {})
  @ftp      = opts.fetch(:ftp)      { Net::FTP.new }
  @host     = opts.fetch(:host)     { DEFAULT_HOST }
  @port     = opts.fetch(:port)     { DEFAULT_PORT }
  @user     = opts.fetch(:user)     { DEFAULT_USER }
  @password = opts.fetch(:password) { DEFAULT_PASSWORD }

  @ftp.passive = true if opts[:passive]
end

Private Instance Methods

connect() click to toggle source
# File lib/hylafax/command.rb, line 22
def connect
  ftp.connect(host, port)
end
login() click to toggle source
# File lib/hylafax/command.rb, line 26
def login
  ftp.login(user, password)
end