Class: HylaFAX::Command
- Inherits:
-
Object
- Object
- HylaFAX::Command
- Defined in:
- lib/hylafax/command.rb
Constant Summary collapse
- DEFAULT_HOST =
'127.0.0.1'
- DEFAULT_PORT =
4559
- DEFAULT_USER =
'anonymous'
- DEFAULT_PASSWORD =
'anonymous'
Instance Attribute Summary collapse
-
#ftp ⇒ Object
readonly
Returns the value of attribute ftp.
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Command
constructor
A new instance of Command.
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
#ftp ⇒ Object (readonly)
Returns the value of attribute ftp.
8 9 10 |
# File 'lib/hylafax/command.rb', line 8 def ftp @ftp end |
#host ⇒ Object (readonly)
Returns the value of attribute host.
8 9 10 |
# File 'lib/hylafax/command.rb', line 8 def host @host end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
8 9 10 |
# File 'lib/hylafax/command.rb', line 8 def password @password end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
8 9 10 |
# File 'lib/hylafax/command.rb', line 8 def port @port end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
8 9 10 |
# File 'lib/hylafax/command.rb', line 8 def user @user end |