Class: HylaFAX::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/hylafax/command.rb

Direct Known Subclasses

FaxStat, SendFax

Constant Summary collapse

DEFAULT_HOST =
'127.0.0.1'
DEFAULT_PORT =
4559
DEFAULT_USER =
'anonymous'
DEFAULT_PASSWORD =
'anonymous'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Command

Returns a new instance of Command.



10
11
12
13
14
15
16
17
18
# 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

Instance Attribute Details

#ftpObject (readonly)

Returns the value of attribute ftp.



8
9
10
# File 'lib/hylafax/command.rb', line 8

def ftp
  @ftp
end

#hostObject (readonly)

Returns the value of attribute host.



8
9
10
# File 'lib/hylafax/command.rb', line 8

def host
  @host
end

#passwordObject (readonly)

Returns the value of attribute password.



8
9
10
# File 'lib/hylafax/command.rb', line 8

def password
  @password
end

#portObject (readonly)

Returns the value of attribute port.



8
9
10
# File 'lib/hylafax/command.rb', line 8

def port
  @port
end

#userObject (readonly)

Returns the value of attribute user.



8
9
10
# File 'lib/hylafax/command.rb', line 8

def user
  @user
end